Show bookmarks with their names

R

Rick Charnes

In a Word2003 doc, is there a way to display all bookmarks **with their
names**? Turning on Show...Bookmarks in Tools|Options doesn't display
their names. Thanks.
 
D

Doug Robbins

Not really.

The following macro will select each bookmark and show its name in a message
box

Dim abm As Bookmark
For Each abm In ActiveDocument.Bookmarks
abm.Select
MsgBox abm.Name
Next

Or if you wanted to know the name of a selected bookmark, you could use

If Selection.Bookmarks.Count > 0 Then
MsgBox Selection.Bookmarks(1).Name
End If

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Top