cadencep45
MIS
Hi,
I am trying to do the following
Print a list of bookmarks in a document, with a page reference for each bookmark.
I can get a list ok, by running the following macro;
Sub BkMarkList()
Dim J As Integer
Selection.TypeParagraph
Selection.InsertBreak Type:=wdColumnBreak
Selection.TypeText Text:="Bookmark list for "
Selection.TypeText Text:=ActiveDocument.Name
Selection.TypeParagraph
For J = 1 To ActiveDocument.Bookmarks.Count
Selection.TypeText Text:=Chr(9)
Selection.TypeText Text:=ActiveDocument.Bookmarks(J).Name
Selection.TypeParagraph
Next J
Selection.InsertBreak Type:=wdColumnBreak
End Sub
however I need to have a page reference for each bookmark, and I have not a clue how to get the page reference. Any help appreciated.
Thanks.
I am trying to do the following
Print a list of bookmarks in a document, with a page reference for each bookmark.
I can get a list ok, by running the following macro;
Sub BkMarkList()
Dim J As Integer
Selection.TypeParagraph
Selection.InsertBreak Type:=wdColumnBreak
Selection.TypeText Text:="Bookmark list for "
Selection.TypeText Text:=ActiveDocument.Name
Selection.TypeParagraph
For J = 1 To ActiveDocument.Bookmarks.Count
Selection.TypeText Text:=Chr(9)
Selection.TypeText Text:=ActiveDocument.Bookmarks(J).Name
Selection.TypeParagraph
Next J
Selection.InsertBreak Type:=wdColumnBreak
End Sub
however I need to have a page reference for each bookmark, and I have not a clue how to get the page reference. Any help appreciated.
Thanks.