macropod
Tue Dec 07 21:58:25 CST 2004
Hi Cowgirl,
The following macro generates a list of all bookmarks at the end of the
active document and displays their contents:
Sub ListBkMrks()
Dim oBkMrk As Bookmark, oBMk As Variant
If ActiveDocument.Bookmarks.Count > 0 Then
For Each oBkMrk In ActiveDocument.Bookmarks
With Selection
.EndKey Unit:=wdStory
.InsertAfter vbCrLf
.InsertAfter oBkMrk.Name & " "
.EndKey Unit:=wdStory
oBMk =
ActiveDocument.Fields.Add(Range:=Selection.Range, Text:= oBkMrk.Name,
PreserveFormatting:=False)
End With
Next oBkMrk
End If
End Sub
Cheers
"Cowgirl Up" <Cowgirl Up@discussions.microsoft.com> wrote in message
news:876BDE13-ED0A-4B74-AC27-BAB2858DA7CD@microsoft.com...
> I am using Word 2003 and would like to view or print all the bookmarks in
a
> document at one time.
>
> In brief: I use these bookmarks in the code of a audit report automation
> program (written in VBA for Word) and need to eleminate a document from
which
> the program calls. I would like to use some of the bookmarks in another
> document and eleminate others. In the past I have had to write each
bookmark
> out on a piece of paper. This method allows room for a lot of errors.
There
> has got to be an easier way! Can any one help?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 19/11/2004