This article was previously published under Q202476
This article has been archived. It is offered "as is" and will no longer be updated.
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.
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.
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:
Steps to reproduce the behavior
Start Visual Basic and create a Standard EXE project. Form1 is created by default.
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.
Press the ESC key to deactivate the Word object, then press the F5 key to run the project. Form1 appears.
Double-click the OLE control to in-place activate the Word document.
Type some text into the document.
Start Microsoft Word 97 or 2000.
Click back to the Visual Basic form.
Try to type more text into the document.Result: You cannot type text into the document.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
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: