Range.InStory method (Word)
True if the range to which this method is applied is in the same story as the range specified by the Range argument.
Syntax
expression. InStory
( _Range_
)
expression Required. A variable that represents a Range object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Range | Required | Range | Specifies the range that this method uses to determine if it is contained within the specified Range object. |
Return value
Boolean
Remarks
A range can belong to only one story.
Example
This example determines whether Range1 and Range2 are in the same story. If they are, bold formatting is applied to Range1.
Set Range1 = Selection.Words(1)
Set Range2 = ActiveDocument.Range(Start:=20, End:=100)
If Range1.InStory(Range:=Range2) = True Then
Range1.Font.Bold = True
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.