Selection.BookmarkID Property (Word)

Returns the number of the bookmark that encloses the beginning of the specified selection. Read-only Long.

expression .BookmarkID

expression A variable that represents a Selection object.

Returns 0 (zero) if there is no corresponding bookmark. The number corresponds to the position of the bookmark in the document—1 for the first bookmark, 2 for the second one, and so on.

This example displays the number of the bookmark that encloses the beginning of the selection.

MsgBox "Bookmark " & Selection.BookmarkID
Show:
© 2014 Microsoft