Article ID: 154568 - Last Review: January 19, 2007 - Revision: 3.4 ACC: How to Use Automation to Find a Location in a Word DocumentThis article was previously published under Q154568
Moderate: Requires basic macro, coding, and interoperability skills.
On This PageSUMMARY
This article shows you how to use Automation to move to a specific
location in a Microsoft Word 6.0 or 7.0 document.
For more information on how to use Automation to move to a specific location in a Microsoft Word 97 document, please see the following article here in the Microsoft Knowledge Base: 160295
(http://support.microsoft.com/kb/160295/EN-US/
)
ACC: How to Use Automation to Find Bookmark in Word 97 Document
This article assumes that you are familiar with Visual Basic for
Applications and with creating Microsoft Access applications using the
programming tools provided with Microsoft Access. For more information
about Visual Basic for Applications, please refer to your version of the
"Building Applications with Microsoft Access" manual.
MORE INFORMATION
By using Automation, it is possible to go to a specific location in a
Microsoft Word 6.0 or 7.0 document. This example uses the WordBasic
EditGoto statement in Microsoft Word for Windows.
Example: Go to a Bookmark in a Microsoft Word DocumentThe following example opens a Microsoft Word document called Wordtest.doc, moves to a pre-defined bookmark, and then inserts some text. The following code samples assume that a document, C:\My Documents\Wordtest.doc, exists and that it contains a pre-defined bookmark, "city" (without the quotation marks).To run this code, follow these steps:
Example: Go to a Bookmark in a Word Document in a Form's Object FrameThis procedure works with an embedded Microsoft Word object on a form. The OLE control on the form is called OLEObj.To run this code:
Instead of using the EditGoto statement to go to a bookmark, you can also use the EditBookmark statement. For more information about the WordBasic EditBookmark command, search for "EditBookmark," using the Microsoft Word 7.0 Help Index. You must have the WordBasic Help file, Wrdbasic.hlp, installed. REFERENCES
For more information about using bookmarks in Microsoft Word, search on
bookmarks, and then Add a bookmark using the Microsoft Word 7.0 Help
Index.
For more information about Automation, search the Help Index for Automation, or working across applications, or ask the Microsoft Access 97 Office Assistant. For more information about the WordBasic EditFind statement used in this article, search on EditFind statement using the Microsoft Word 7.0 Help Index. You must have the WordBasic help file, Wrdbasic.hlp, installed. For more information about the WordBasic EditGoto statement used in this article, search on EditGoto statement in the Microsoft Word 7.0 Help Index. You must have the WordBasic help file Wrdbasic.hlp installed. For more information about the Microsoft Access Verb and Action properties, search the Help Index for Verb property or Action property. APPLIES TO
| Article Translations
|

Back to the top
