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: Removing All Bookmarks.

Removing All Bookmarks

by Allen Wyatt
(last updated January 4, 2014)

3

Some people absolutely love bookmarks. They do come in handy, but if someone else set bookmarks in a document, you may not need them once you get the document from them. If there are many, many bookmarks set (remember, we are talking about people who really love bookmarks), removing them all one at a time can be rather tedious.

If you find yourself in this situation, you will want to keep the following macro handy. It examines the active document (the one you are looking at) and removes all the bookmarks within it.

Sub RemoveAllBookmarks()
    Dim objBookmark As Bookmark

    For Each objBookmark In ActiveDocument.Bookmarks
        objBookmark.Delete
    Next
End Sub

You should note that this simply deletes the bookmark, not any text referenced by the bookmark.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9004) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Removing All Bookmarks.

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

Field Reference to Number of Prior Pages

Fields are used for all sorts of purposes in Word, but typically to provide some sort of dynamic information. This tip shows ...

Discover More

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

Creating a Bibliography from Footnotes

Most scholarly papers need to have both footnotes and a bibliography. The two are closely related, as they provide different ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

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

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

Protecting Bookmarks

Bookmarks are a great boon in developing and working with documents—until someone deletes them. When it comes to ...

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 8Mpixels. 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 5 + 0?

2014-01-07 07:56:49

Bryan

@CaroleJean: The "If ActiveDocumnt.Bookmarks.Count >=1 Then / End If" lines are unnecessary if you are going to use a For Each loop. That's really the whole reason to use a For Each loop.


2014-01-06 09:15:01

CaroleJean

This macro will delete all bookmarks including hidden bookmarks.

Sub RemoveAllBookmarks()
Dim stBookmark As Bookmark
ActiveDocument.Bookmarks.ShowHidden = True
If ActiveDocument.Bookmarks.Count >= 1 Then
For Each stBookmark In ActiveDocument.Bookmarks
stBookmark.Delete
Next stBookmark
End If
End Sub


2014-01-04 14:01:40

Ken Endacott

Word creates hidden bookmarks for such things as links from Table of Contents and deleting them could affect the document in unexpected ways. The following macro will delete only user created bookmarks and not hidden bookmarks
Sub RemoveAllBookmarks()
Dim objBookmark As Bookmark

For Each objBookmark In ActiveDocument.Bookmarks
if left(objBookmark.name,1) <> "_" then objBookmark.Delete
Next
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.