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

Printing a Bookmark List

by Allen Wyatt
(last updated January 3, 2015)

8

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 (8880) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word 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

Selecting an Entire Worksheet

While editing, you may need to select everything in a worksheet. Excel provides three easy ways you can accomplish this.

Discover More

Printing Multiple Worksheet Ranges

Need to print more than one portion of your worksheet? If you use named ranges for the different ranges you want to print, ...

Discover More

Mouse Stops Working in Word

Could you use Word without the assistance of your mouse? For most people the answer would be a resounding "no." What are you ...

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 (ribbon)

Making Bookmarks Bold

Do you want an easy way to see all the bookmarks in your document? Word provides a way to make them visible, or you can use ...

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 in ...

Discover More

Bookmark Error when Printing

Bookmarks are commonly used in Word documents as a way to cross-reference information. If the bookmark referenced by 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 4 + 1?

2015-08-23 21:03:16

awyatt

Sandy: Yes, that would be good takeaway.

-Allen


2015-08-23 16:16:37

Sandy Deja

My takeaway from this is that I cannot do it if I do not know how to do a VBA macro. Correct?


2015-07-27 11:11:17

Lisa

By the way, this is the GetFolder I was trying to use:

Get Folder:
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function


2015-07-27 11:09:36

Lisa

Can you adjust this to scan an entire folder of Word docs? I have a GetFolder I can use, but I'm not sure how to add this together to get the names of all the bookmarks in all the files in the folder. Any help would be GREATLY appreciated!! Thank you!


2015-02-15 21:07:59

Mike

I ended up creating a script that prints the bookmark name alongside the bookmarked text with the code below:

Sub NewBrackets()
Dim i As Long
Dim strBookmark As String

With ActiveDocument
For i = 1 To .Bookmarks.Count
strBookmark = .Bookmarks(i).Name
With .Bookmarks(i).Range
.InsertBefore "["
.InsertAfter "]("
.InsertAfter strBookmark
.InsertAfter ")"
End With
Next i
End With
End Sub

--
I also like Ken's solution too!


2015-02-14 06:19:25

Ken Endacott

The following macro will in the body of the document, highlight bookmarked text in blue followed by the bookmark name in red.

Sub ShowBookmarks()
Dim j As Long
Dim BMark As Bookmark
Dim aRange As Range
For Each BMark In ActiveDocument.Bookmarks
With BMark
If Left(.Name, 1) <> "_" Then
.Range.Font.ColorIndex = wdBlue
.Range.Select
Selection.Collapse direction:=wdCollapseEnd
Selection.Font.ColorIndex = wdRed
Selection.TypeText " " & .Name
End If
End With
Next BMark
End Sub


2015-02-13 13:52:01

Mike

How would you modify this so that it prints the bookmark name alongside the bookmarked text?


2015-01-03 06:30:09

Ken Endacott

The macro will also list normally hidden system generated bookmarks that have an underscore character in the first character of the name. Listing the system bookmarks can be confusing because whenever a Table of Contents is replaced a new set of heading bookmarks is created but the old ones are not deleted. It is possible to end up with hundreds of unused system bookmarks in a heavily edited document.

Also, it may be useful to print alongside the bookmark name, the bookmarked text.

The following version of the macro will ignore system generated bookmarks and print the bookmarked text after the bookmark name. If you don't want the bookmarked text then remove the marked statement.

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
With ActiveDocument.Bookmarks(J)
If Left(.Name, 1) <> "_" Then
Selection.TypeText Text:=Chr(9)
Selection.TypeText Text:=.Name
' ******* the following line adds the bookmarked text *******
Selection.TypeText Text:=" Text= " & .Range.Text
Selection.TypeParagraph
End If
End With
Next J
Selection.InsertBreak Type:=wdColumnBreak
End Sub


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu 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.