Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Printing a Bookmark List.

Printing a Bookmark List

by Allen Wyatt
(last updated October 17, 2015)

2

Word provides a very powerful bookmark facility that allows you to assign names to either individual positions in your document or to text selections. As you work more with Word, and particularly in long documents, it would be helpful to periodically print a list of bookmarks. Unfortunately, Word does not provide an automatic method of printing bookmarks, as it does with other document-related information. The quickest way to print a bookmark list is to just insert the list in your document and then print it. The following VBA macro inserts the bookmark list at the insertion point:

Sub BkMarkList()
    Dim J as Integer

    Selection.TypeParagraph
    Selection.InsertBreak Type:=wdColumnBreak
    Selection.TypeText Text:="Bookmark list for "
    Selection.TypeText Text:=ActiveDocument.Name
    Selection.TypeParagraph
    For J = 1 To ActiveDocument.Bookmarks.Count
        Selection.TypeText Text:=Chr(9)
        Selection.TypeText Text:=ActiveDocument.Bookmarks(J).Name
        Selection.TypeParagraph
    Next J
    Selection.InsertBreak Type:=wdColumnBreak
End Sub

When you run the macro, a heading indicating the name of the file will be inserted, followed by each bookmark in the file. These will be in alphabetic order. The bookmark list has a column break before it and after it, as well. You can then print out the single page that contains the bookmark list. When you are done printing, you can delete the bookmark list.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1019) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Printing a Bookmark List.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Renaming a Toolbar

Word allows you to create custom toolbars that can speed how you work with various tools and macros. When you first ...

Discover More

Conditional Formatting Based on Date Proximity

Conditional formatting can be used to draw your attention to certain cells based on what is within those cells. This tip ...

Discover More

Always Opening a Workbook that is Editable

When you send a workbook to a coworker, it can be bothersome if that person has problems using what you created. There is ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Getting the Names of Defined Bookmarks

When creating a macro, you may need to determine the names of the bookmarks in the document. You can do this using the ...

Discover More

Printing a Bookmark List with Contents

Bookmarks can be a great tool in Word, allowing you to easily remember the location of desired blocks of text. If you ...

Discover More

Getting Bookmark Information in VBA

Bookmarks are a handy way to "mark" locations within a document. If you are creating a macro that processes the document ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 + 7?

2017-12-13 23:40:46

jamal

I have a code in Word that extracts all references in the document in a table showing its name, page number, and line.
This is the code:
Sub ListBkMrks()
Application.ScreenUpdating = False
Dim oBkMrk As Bookmark, rng As Range, StrTxt As String, StrStory As String
With ActiveDocument
Set rng = .Range.Characters.Last
If .Bookmarks.Count > 0 Then
With rng
.Text = vbCrLf & "Bookmark" & vbTab & "Page" & vbTab & "Line" & vbTab & "Story Range" & vbTab & "Contents"
For Each oBkMrk In ActiveDocument.Bookmarks
.InsertAfter vbCrLf & oBkMrk.Name & vbTab
.InsertAfter oBkMrk.Range.Characters.First.Information(wdActiveEndAdjustedPageNumber)
.InsertAfter vbTab & oBkMrk.Range.Information(wdFirstCharacterLineNumber)
Select Case oBkMrk.StoryType
Case 1: StrStory = "Main text"
Case 2: StrStory = "Footnotes"
Case 3: StrStory = "Endnotes"
Case 4: StrStory = "Comments"
Case 5: StrStory = "Text frame"
Case 6: StrStory = "Even pages header"
Case 7: StrStory = "Primary header"
Case 8: StrStory = "Even pages footer"
Case 9: StrStory = "Primary footer"
Case 10: StrStory = "First page header"
Case 11: StrStory = "First page footer"
Case 12: StrStory = "Footnote separator"
Case 13: StrStory = "Footnote continuation separator"
Case 14: StrStory = "Footnote continuation notice"
Case 15: StrStory = "Endnote separator"
Case 16: StrStory = "Endnote continuation separator"
Case 17: StrStory = "Endnote continuation notice"
Case Else: StrStory = "Unknown"
End Select
.InsertAfter vbTab & StrStory & vbTab & oBkMrk.Range.Text
Next oBkMrk
.Start = .Start + 1
.ConvertToTable Separator:=vbTab
.Tables(1).Rows.First.Range.Font.Bold = True
'.Copy
End With
End If
End With
Set rng = Nothing
Application.ScreenUpdating = True
End Sub
I just want a code to make this code copy all references from this document with the same name and same page number, and the same number of lines in another document


2016-03-20 13:10:16

Jim Walton

If you need the list in location order rather than alphabetical order, here is a quick fix:

Change:
Selection.TypeText Text:=ActiveDocument.Bookmarks(J).Name
To:
Selection.TypeText Text:=ActiveDocument.Range.Bookmarks(J).Name

This works for Word 2016.


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.