Selection.InStory method (Word)
True if the selection to which this method is applied is in the same story as the range specified by the Range argument.
expression Required. A variable that represents a 'Selection' object.
|Range||Required||Range||The range whose story is compared with the story of the current selection.|
A range can belong to only one story.
This example determines whether the selection is in the same story as the first paragraph in the active document. The message box displays "False" because the selection is in the primary header story and the first paragraph is in the main text story.
With ActiveDocument.ActiveWindow.View .Type = wdPrintView .SeekView = wdSeekCurrentPageHeader End With same = Selection.InStory(ActiveDocument.Paragraphs(1).Range) MsgBox same