StoryType Property Example

This example returns the story type of the selection.

story = Selection.StoryType

This example closes the footnote pane if the selection is contained in the footnote story.

ActiveDocument.ActiveWindow.View.Type = wdNormalView
If Selection.StoryType = wdFootnotesStory Then _
    ActiveDocument.ActiveWindow.ActivePane.Close

This example selects the bookmark named "temp" if the bookmark is contained in the main story in the active document.

If ActiveDocument.Bookmarks.Exists("temp") = True Then
    Set myBookmark = ActiveDocument.Bookmarks("temp")
    If myBookmark.StoryType = wdMainTextStory _
        Then myBookmark.Select
End If