Using Special Reserved Bookmarks in WordBasic

Last reviewed: July 30, 1997
Article ID: Q69496
The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c

SUMMARY

There are several reserved bookmarks that can be set and automatically updated in Word for Windows using the WordBASIC macro language.

MORE INFORMATION

Bookmarks can be set in a Word for Windows document as a way of getting to a specific reference point quickly from anywhere in the document. You can set defined bookmarks manually or use the reserved bookmarks that Word places in a document and automatically updates. These reserved bookmarks and their definitions are listed along with examples on pages 103-107 of the "Microsoft Word for Windows and OS/2 Technical Reference."

The reserved bookmarks can be used with several WordBASIC statements in macros for specific tasks. One useful WordBASIC statement used with reserved bookmarks is the CmpBookmarks() statement. This statement is used to compare bookmarks. This can be useful in performing a particular task on text between two bookmarks.

For example:

Sub Main
While CmpBookmarks ("\Sel", "\EndOfDoc") . . . Wend
End Sub

This macro sets one bookmark at the current selection or the insertion point (\Sel), and one bookmark at the end of the document (\EndOfDoc) and executes the commands listed between the While and Wend statements until Sel is equal to EndOfDoc. As a result, the desired action is performed on the text from the initial position of the cursor to the end of the document. This is just one example of how the special reserved bookmarks can be used in Word for Windows.

Reference(s):

"Using WordBasic," by WexTech Systems and Microsoft, pages 88-90.

"Microsoft Word for Windows and OS/2 Technical Reference," pages 103-107.


KBCategory: kbmacro
KBSubcategory:
Additional query words: endofdocument test eof winword winword2
2.0 2.0a 2.0a-CD 2.0b 2.0c


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.