ACC: Finding a Location in a Word Document Using AutomationLast reviewed: August 28, 1997Article ID: Q154568 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article demonstrates 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:
ARTICLE-ID: Q160295 TITLE : ACC: Finding a Bookmark in a Word 97 Document Using AutomationThis 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 INFORMATIONThrough 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:
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.
REFERENCESFor 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." Keywords : AutoGnrl kbinterop IntpOleA Technology : kbole Version : 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |