Bookmarks/crossreferences

  • Thread starter Thread starter RobinR
  • Start date Start date
R

RobinR

How does one reference the list of bookmarks which come up
in the insert bookmark dialog box and in the
crossreference dialog box. That is how do you know what
reference in the list refer to. I have a large number of
bookmarks in a document but I have not made a manual list
of the references so I don't know which bookmark relates
to which reference in the text. There must be some
underlying format which relates each entry in the bookmark
list to each entry in the text. How do you access this
format?

Thanks RobinR
 
Really the only way to tell is to select bookmarked text, go to Insert |
Bookmark, and look at the highlighted bookmark, which will be the one for
the highlighted text. Or perhaps you could enter the bookmark name in the Go
To dialog (but I suspect it doesn't support hidden bookmarks)?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Hi Robin,

Here's a macro that might help:

Sub GetBkMrks()
Dim aBmk As Bookmark
Dim strBmkName As String
If Documents.Count > 0 Then
For Each aBmk In ActiveDocument.Bookmarks
strBmkName = strBmkName & vbCrLf & aBmk.Name & " " & aBmk.Name
Next aBmk
End If
Set MyData = New DataObject
MyData.SetText strBmkName
MyData.PutInClipboard
End Sub

It copies all of your bookmark names to the clipboard. If you then go to the
end of the document and do a Paste, they'll be listed twice - one pair per
para eg:
BkMrk1 MkMrk1
BkMrk2 MkMrk2
and so on. If you select the 2nd instance of each of these and press
Ctrl-F9, so that you get something like:
BkMrk1 { MkMrk1 }
You can then press F9 to see what the bookmark of that name refers to, eg:
BkMrk1 The quick brown fox jumps over the lazy dog.

Cheers
 
Thank you - that does seem to do it.

RobinR

-----Original Message-----
Really the only way to tell is to select bookmarked text, go to Insert |
Bookmark, and look at the highlighted bookmark, which will be the one for
the highlighted text. Or perhaps you could enter the bookmark name in the Go
To dialog (but I suspect it doesn't support hidden bookmarks)?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.



.
 
Hi again, Robin,

Here's an update on the previous macro. This one automates the whole
process, generating a list of all bookmarks at the end of the active
document and inserting a field to display their contents next to their
names.

Cheers

Sub GetBkMrks()
If ActiveDocument.Bookmarks.Count > 0 Then
For Each oBmk In ActiveDocument.Bookmarks
With Selection
.EndKey Unit:=wdStory
.InsertAfter oBmk.Name & " "
.EndKey Unit:=wdStory
oBkMrk =
ActiveDocument.Fields.Add(Range:=Selection.Range, Text:=oBmk.Name,
PreserveFormatting:=False)
.InsertAfter vbCrLf
End With
Next oBmk
End If
End Sub
 
Back
Top