WD: Jumping to a Bookmark Located in a Header or Footer

Last reviewed: February 16, 1998
Article ID: Q113758
The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Word for the Macintosh, versions 6.0, 6.0.1

SUMMARY

The versions of Word listed above allow you to insert bookmarks into a document header or footer. In versions of Word prior to Word 97 and Word 98 Macintosh Edition, you can only jump to a bookmark in a document header or footer when the header or footer pane is active.

This article contains macro samples that demonstrate how to jump to a bookmark in a header or footer.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

     
   http://www.microsoft.com/support/supportnet/refguide/default.asp

This example shows how to jump to a bookmark in the document header:

  1. On the View menu, click Header And Footer.

  2. On the Edit menu, click Bookmark.

  3. Select a bookmark name, and then click Go To.

NOTE: Bookmarks in the header or footer pane are not listed in the Edit Go To dialog box, regardless of where the insertion point is located.

WordBasic can open the document header or footer, check that the bookmark exists, and then go to the bookmark using the EditBookmark statement.

The following sample macro opens the header pane and goes to the bookmark named Test.

   Sub MAIN
      If ViewHeader() = 0 Then ViewHeader
      If ExistingBookmark("test") Then
         EditBookmark "test", .Goto
      End If
   End Sub

The following sample macro opens the footer pane and goes to the bookmark named Test.

   Sub MAIN
      If ViewFooter() = 0 Then ViewFooter
      If ExistingBookmark("test") Then
         EditBookmark "test", .Goto
      End If
   End Sub


Additional query words: editbookmark go to
Keywords : kbmacroexample winword winword2 word6 word7 word95 macword6 word
Version : WINDOWS: 2.x 6.0 6.0a 6.0c 7.0 7.0a; MACINTOSH: 6.0,6.01,6.01a
Platform : MACINTOSH WINDOWS
Issue type : kbhowto


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: February 16, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.