HOWTO: Scroll an Embedded Word 6 Document in VB OLE
Article ID: 147804
Article Last Modified on 1/19/2007
APPLIES TO
- Microsoft Word 2000 Standard Edition
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
- Microsoft Visual Basic 4.0 Standard Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 Enterprise Edition
- Microsoft Word 97 Standard Edition
This article was previously published under Q147804
SUMMARY
The versions of Microsoft Word listed at the beginning of this article do
not supply scroll bars that allow an activated document embedded in the
Visual Basic OLE container control to be scrolled through. This article
describes how to provide buttons that allow the user to scroll through an
embedded Word document that has been activated for visual editing.
To scroll through the window, you must call a Word Basic method such as
VLine. However, if you call the method from within a scroll-bar event, the
code does not work. The problem is that when the scroll bar receives the
focus, the Word document object in the OLE control is deactivated. If you
try to activate the Word Document object in the scroll-bar event, the
insertion point moves to the beginning of the document, causing you to lose
the current position in the document. This problem happens with any control
that can receive the focus.
Keywords: kbautomation kbhowto kbinterop KB147804