|
|
|
|
|
|
Word
|
List Bookmarks in a Document
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000
|
Submitted by:
|
Anne Troy
|
Description:
|
Provides a messagebox with a list of all bookmarks in the active document.
|
Discussion:
|
You may need to see a list of all the bookmarks in your document. This macro is helpful in providing that list. They are listed in the order in which they are located in the document.
|
Code:
|
instructions for use
|
Option Explicit
Sub GetBmks()
Dim bmk As Bookmark
Dim msg As String
For Each bmk In ActiveDocument.Range.Bookmarks
msg = msg & bmk.Name & vbCr
Next bmk
MsgBox msg
End Sub
|
How to use:
|
- Copy the code above.
- Open the file that contains the bookmarks.
- Hit Alt+F11 to open the Visual Basic Editor (VBE).
- Select the file on the left.
- Choose Insert-Module and paste the code into the new code window at right.
- Save the file and close the VBE.
|
Test the code:
|
- Tools-Macro-Macros and double-click GetBmks.
|
Sample File:
|
getbookmarks.zip 5.66KB
|
Approved by mdmackillop
|
This entry has been viewed 135 times.
|
|