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

Range.InRange Method (Word)

Published: July 16, 2012

Returns True if the range to which the method is applied is contained in the range specified by the Range argument.

expression .InRange(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

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

This example sets myRange equal to the first word in the active document. If myRange is not contained in the selected range, myRange is selected.

Set myRange = ActiveDocument.Words(1) 
If myRange.InRange(Selection.Range) = False Then myRange.Select
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.