Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. 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: Preserving Bookmarks During Replace Operations.

Preserving Bookmarks During Replace Operations

Written by Allen Wyatt (last updated June 10, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


Bookmarks are a handy feature of Word, and they can be used for a variety of purposes. (Bookmarks have been discussed extensively in other WordTips.) When you define a bookmark, you essentially are providing a name by which either a location or a group of characters can later be referenced in a document. For instance, you could highlight a client's name, and then define a bookmark called Client that could be used elsewhere in the document to refer to the client's name.

When you do a search and replace operation, it is possible to inadvertently erase a bookmark. For instance, consider the following text:

This agreement between [John Doe] and [Mary Smith]
is entered into freely and without compulsion.

The brackets in this text indicate the beginning point and ending point of two bookmarks. (The brackets would not appear in the actual text; they are only provided here to help clarify the example.) If you search for either "John Doe" or "Mary Smith" and replace the names with new names, the bookmarks disappear. This can be a problem for other places in your document where you may reference the bookmarks. All of a sudden, there is nothing left to reference.

Why are the bookmarks deleted? Quite simply, it is because you have deleted the bookmark. Everything that was in the bookmark is gone, so Word no longer needs the bookmark and it is tossed aside. The solution to this problem is to be very careful in how you construct your bookmarks, or be careful in how you do your search and replace. For instance, you could define your bookmarks a bit differently:

This agreement between[ John Doe ]and[ Mary Smith ]
is entered into freely and without compulsion.

Note that in this example, the spaces surrounding the names are included in the bookmarks. Now, when you search and replace for the entire names, the text that makes up the bookmark is never deleted (the spaces would remain), so Word doesn't toss out the bookmarks.

The other option involves changing how you do your search and replace. Since the idea is to make sure that at least some of the text from the original bookmark remains in place after a search and replace operation, you can do two search and replace operations instead of one. For instance, if you want to replace John Doe with Margaret Brown, in your first search and replace you would replace John with Margaret and in your second search and replace you would replace Doe with Brown. The result is that you never fully replace the original text of the bookmark, and it should remain in place when you are done.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12095) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Word here: Preserving Bookmarks During Replace Operations.

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

Password Protection Loophole

Make sure your current and backup files are protected. Follow these steps to ensure the protection.

Discover More

Professional Looking Fractions

Professional typesetting has, in many ways, spoiled us. One way this is evident is in the preference we show for making ...

Discover More

Changing Shading when a Column Value Changes

If you have a data table in a worksheet, and you want to shade various rows based on whatever is in the first column, ...

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)

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

Removing All Bookmarks

Need to get rid of a lot of bookmarks all at once? Word doesn't provide a way to do it, but you can use the short macro ...

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}] (all 7 characters, in the sequence shown) 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 two more than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.

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