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.

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

Inserting a Document's Location

Once you save a document on disk, it is stored in a particular folder (or location) on that disk. You may want that ...

Discover More

Selecting a Paper Source

If your printer allows you to specify different paper trays as sources for paper, you need to know how to select those ...

Discover More

Decreasing a Paragraph's Indent

When formatting your document, you often have a need to indent paragraphs. If you later want to decrease the indent used ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

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

Determining the Number of Bookmarks Defined in a Document

If you develop a macro that needs to work with bookmarks defined in a document, it is inevitable that you will need a way ...

Discover More

Automatically Referencing Info Entered in a Table

Tables are a great way to organize information in a document. At some point you may want a cell in a table to contain the ...

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 five less than 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.