Range.InStory Method (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

True if the range to which this method is applied is in the same story as the range specified by the Range argument.

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

A range can belong to only one story.

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

Concepts

Other resources

Show: