Microsoft KB Archive/268278

= BUG: Embedded Word Document Scrolls to Top While Editing In-Place =

Article ID: 268278

Article Last Modified on 5/13/2007

-

APPLIES TO


 * Microsoft Office Word 2007
 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition
 * Microsoft Word 2000 Standard Edition
 * Microsoft Word 97 Standard Edition
 * Microsoft Visual Basic 6.0 Professional Edition

-



This article was previously published under Q268278



SYMPTOMS
When a Microsoft Word document that is embedded in an OLE Container Control is activated in-place, the document's window may automatically scroll to the beginning of the document while editing. This problem occurs when the document has scrolled beyond the region that can be viewed on the window.



CAUSE
The problem is due to the auto-resize behavior of Word OLE objects. When an embedded Word document is activated in-place, Word automatically attempts to resize the object so that the entire content of the document is displayed. As more text is added to the document, the OLE object is supposed to &quot;grow&quot; to allow the text to become visible in the container. This is the behavior you see when Word is embedded in a Microsoft Excel worksheet or a Microsoft PowerPoint slide.

However, if Word attempts to resize while the document is hosted in an OLE Container Control, the resize fails and the document is scrolled to the top instead.



RESOLUTION
There is no resolution to this problem when in-place editing a Word document in a container that does not support dynamic resizing. There are, however, alternative ways to edit embedded Word documents:  Open the document in a separate Word window rather than editing the document in-place. This allows you full access to all the commands and features of Word.

-or-

 Use the Web Browser control for hosting a Word document on a form. ActiveX Documents are not limited in size and scope as OLE objects are, allowing you to scroll and perform page layout while in-place. For additional information, click the article number on this topic below to view the article on this topic in the Microsoft Knowledge Base:

243058 HOWTO: Use the WebBrowser Control to Open an Office Document





STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior

 * 1) Start a new Standard EXE project in Visual Basic. Form1 is created by default.
 * 2) Add an OLE Control to Form1.
 * 3) Choose to insert a new Microsoft Word Document when prompted.
 * 4) Press the F5 key to run the program.
 * 5) Double-click the OLE Control to in-place activate the Word document for editing.
 * 6) Type multiple lines of text in the Word document until the document scrolls enough that the first lines of text do not appear in the window, and then wait for a few seconds.

Results: The document window automatically scrolls to the top.

