Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Selection.InRange Method (Word)

Published: July 16, 2012

True if the selection to which the method is applied is contained within the range specified by the Range argument.

expression .InRange(Range)

expression Required. A variable that represents a Selection object.

Parameters

Name

Required/Optional

Data Type

Description

Range

Required

Optional

The Range to which you want to compare the selection.

Return Value

Boolean

This method determines whether the range or selection returned by expression is contained in the specified Range by comparing the starting and ending character positions and the story type.

This example determines whether the selection is contained in the first paragraph in the active document.

status = Selection.InRange(ActiveDocument.Paragraphs(1).Range)

This example displays a message if the selection is in the footnote story.

If Selection.InRange(ActiveDocument _ 
 .StoryRanges(wdFootnotesStory)) Then 
 MsgBox "Selection in footnotes" 
End If
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.