BUG: Cannot Edit Word Document in OLE or WebBrowser Control

ID: Q202476


The information in this article applies to:
  • Microsoft Word 97 for Windows
  • Microsoft Word 2000


SYMPTOMS

When using the OLE control or WebBrowser control on a form in Microsoft Visual Basic to view a Microsoft Word document, you are unable to type any text into the Word document.


CAUSE

This problem occurs if a separate instance of Microsoft Word is running and you switch focus to that instance of Word. When you switch focus back to your Visual Basic form, the Word document in the OLE control or WebBrowser control can no longer be edited.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Visual Basic and create a Standard EXE project. Form1 is created by default.


  2. Add the OLE control to Form1. When the Insert Object dialog box appears, select Microsoft Word Document and OK. This embeds a new Word document into the OLE control.


  3. Press the ESC key to deactivate the Word object, then press the F5 key to run the project. Form1 appears.


  4. Double-click the OLE control to in-place activate the Word document.


  5. Type some text into the document.


  6. Start Microsoft Word 97 or 2000.


  7. Click back to the Visual Basic form.


  8. Try to type more text into the document.


  9. Result: You cannot type text into the document.
Workaround

A workaround for this problem is to activate the Word document in its own Window, rather than using in-place activation. To accomplish this, set the MiscFlags property of the OLE control to vbOLEMiscFlagDisableInPlace, or 2. For example:

OLE1.MiscFlags = vbOLEMiscFlagDisableInPlace 
Now when you double-click the OLE control, the Word document is activated in its own window inside Microsoft Word. To programmatically activate the Word document in its own window, use the DoVerb method as follows:

OLE1.DoVerb vbOLEOpen 


REFERENCES

If you are using the WebBrowser control instead of the OLE control, the following Knowledge Base article shows how to configure your system so that the Word document is activated in its own window inside Microsoft Word:

Q162059 Office Documents Open in Internet Explorer
For additional information, please click the article numbers below to view the articles in the Microsoft Knowledge Base:
Q191615 BUG: Menu Disabled in Application Activated Using OLE Control

Q221195 Sample: OFramer.exe Automates Excel and Word Inside a VB Form

Additional query words: schdocvw.dll uneditable locked hang frozen ie frame

Keywords : kbContainer kbInplaceAct kbVBp kbWebBrowser kbWord kbGrpDSO kbDSupport
Version : WINDOWS:2000,97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.