Microsoft KB Archive/105885
Article ID: 105885
Article Last Modified on 1/18/2007
- Microsoft Word 6.0 Standard Edition
- Microsoft Word 6.0a
- Microsoft Word 6.0c
- Microsoft Word 95 Standard Edition
- Microsoft Word 95a
- Microsoft Word 6.0 for Macintosh
- Microsoft Word 6.01 for Macintosh
- Microsoft Word 6.01 for Macintosh
- Microsoft Word 97 Standard Edition
- Microsoft Word 98 for Macintosh
This article was previously published under Q105885
When you use the Go To command in Microsoft Word, you cannot go from one subdocument (or document component) to a bookmark in another subdocument or the main body of the document. Similarly, you cannot go from the main body of a document to a bookmark in a subdocument. In other words, you cannot go from one layer of a document to a bookmark in another layer. The bookmark does not appear on the Bookmark Name list in the Edit Go To dialog boxes. In the Edit Bookmark dialog box, the Go To button is unavailable when you select a bookmark in another layer or subdocument.
NOTE: As used in this article, the word "subdocument" refers to document components and not to the documents in a master document. The main body of the document is what you can see in normal view. The following document elements are examples of subdocuments or document components: headers or footers, footnotes, endnotes, annotations, text boxes, or callouts.
- You cannot go from a header to a bookmark in a footnote, and you cannot go from the main body to a bookmark in the header.
- If you create a text box (using the Text Box button on the Drawing toolbar) and then insert a bookmark in that text box, you cannot go to the bookmark unless you position the insertion point in the text box. If your insertion point is in the main body of the document or in any other layer of the document, you cannot go to the bookmark using the Go To command. In other words, you cannot go from the drawing layer in one subdocument to a bookmark in the drawing layer of the main body or another subdocument.
You can, however, go from one text box in the drawing layer of the main body to a bookmark in another text box in the drawing layer of the main body because both text boxes are in the same layer of the same subdocument.
To work around this problem, use the appropriate method for your situation.
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 professionals 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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
Position the insertion point in the subdocument before you go to the bookmark.
Method 2 (Word 97 and Word 98)
Write a Visual Basic for Applications macro that checks for the existence of the bookmark and if it exists, goes to that bookmark. The following macro checks for and goes to the bookmark "test", if it exists:
If ActiveDocument.Bookmarks.Exists("test") = True Then ActiveDocument.Bookmarks("test").Select Else MsgBox "Specified bookmark does not exist." End If
Method 3 (Word 6 and Word 7)
Write a WordBasic macro that goes to the text box and searches for a bookmark. The following macro searches for the first text box in the document and locates the bookmark called "test."
Sub main DrawSetRange "\Doc" Select Case DrawGetType(1) Case 3 'Text box DrawSetInsertToTextbox 1 Case 8 'Callout DrawSetInsertToTextbox 1 Case Else End Select EditGoTo .Destination = "test" End Sub
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
There is an exception to this behavior. If the insertion point is in a header or footer when you click Go To on the Edit menu, Word moves the insertion point into the body of the document and returns it to the last position before you switched to the header or footer. This means you cannot go to a bookmark in the header or footer using the Go To command on the Edit menu. This does not happen when you use the Bookmark command on the Edit menu and click Go To; the insertion point stays in the header or footer and you can go to your bookmark, as expected.
Visual Basic for Applications Example
Sub FindBookmark() ActiveWindow.ActivePane.View.Type = wdPageView ActiveWindow.View.SeekView = wdSeekCurrentPageHeader ActiveDocument.Bookmarks("test").Select End Sub
The following macro opens the Header/Footer and goes to the suggested bookmark.
Sub Main ViewHeader(Footer) EditBookmark .Name="test", Goto End Sub
Additional query words: .goto argument sub-document sub document 8.0 8.00
Keywords: kbbug kbmacro kbmacroexample kbprogramming kbdtacode KB105885