PreviousBookmarkID Property

Applies To

Range object, Selection object.

Description

Returns the number of the last bookmark that starts before or at the same place as the specified selection or range; returns 0 (zero) if there's no corresponding bookmark. Read-only Long.

See Also

BookmarkID property.

Example

This example selects the previous bookmark in the active document.

num = Selection.PreviousBookmarkID
If num <> 0 Then ActiveDocument.Content.Bookmarks(num).Select
This example displays the name of the bookmark that precedes the second paragraph.

num = ActiveDocument.Paragraphs(2).Range.PreviousBookmarkID
If num <> 0 Then MsgBox ActiveDocument.Content.Bookmarks(num).Name