How to Use Bookmarks in Word 2007 Macros
Word 2007's bookmarks let you create placeholders in your document for you to return to quickly, later. This feature is especially useful when you need to expound on a topic that you summarized in the beginning of a document. Word's macros let you write programs that perform any of the bookmark operations you can do manually. These operations include creating bookmarks and navigating to them. Understanding how to use bookmarks in your Word macros lets you manage bookmarks much more quickly than you can by using the "Insert" tab's "Bookmark" command.
Instructions
-
Set a Bookmark
-
1
Click the "Developer" menu heading in Word, then click the "Record" button.
-
2
Type the name "SetBookmark" in the text box at the top of the dialog box that appears.
-
-
3
Click "OK" to start recording the macro.
-
4
Click the "Bookmark" command under Word's "Insert" menu.
-
5
Type a name for the bookmark in the dialog box that appears. For example, type "a."
-
6
Click "Add" to add the bookmark, then click the "Stop recording" button under the "Developer" tab.
-
7
Repeat Step 4 to open the bookmark dialog box, then select the bookmark you added earlier.
-
8
Click "Delete" to delete the bookmark. You'll now play back the macro you recorded to re-insert the bookmark you just deleted.
-
9
Click the "Macros" button of the "Developer" tab, then double-click the "SetBookmark" item in the list of macros. Word will run the macro.
-
10
Use Step 4 to open the bookmark dialog box. Notice that the bookmark you deleted earlier has returned.
Go to a Bookmark
-
11
Click the "Bookmark" button under the "Insert" tab, then type a name for a bookmark. Click "Add" to add the bookmark.
-
12
Click the "Record" button under the "Developer" tab, then type "GotoBookmark" in the text box at the top of the dialog box that appears.
-
13
Click "OK," then repeat Step 1 to reopen the dialog box displaying your document's bookmarks.
-
14
Click the bookmark you set in Step 1, then click "Go to" to go to that bookmark.
-
15
Click the "Developer" tab's "Stop recording" button to end the macro recording.
-
16
Press "Control" and "Home" or "Control" and "End" simultaneously to navigate to another part of the document, away from the bookmark you set.
-
17
Click the "Developer" tab's "Macros" button to display a list of macros in your document.
-
18
Double-click the "GotoBookmark" item to run your macro. Word will navigate back to the bookmark you set, indicating the effect of the macro.
-
1