bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Editing > Find and Replace > Preserving Bookmarks During Replace Operations

Preserving Bookmarks During Replace Operations

Summary: Without an understanding of how bookmarks work, it is easy to wipe them all out by doing a replace operation. (This tip works with Microsoft Word 6, Word 95, Word 97, Word 2000, Word 2002, and Word 2003.)

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.

Tip #856 applies to Microsoft Word versions: 6 | 95 | 97 | 2000 | 2002 | 2003


Save Time! WordTips has been published weekly since early 1997. Past issues are available in convenient WordTips archives. Have your own enhanced archive of WordTips at your fingertips, available to use at any time!
 
Check out WordTips Archives today!

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Vital News Home

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)