Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IsEqual Method
Collapse the table of content
Expand the table of content

Selection.IsEqual Method (Word)

True if the selection to which this method is applied is equal to the range specified by the Range argument.

expression .IsEqual(Range)

expression Required. A variable that represents a Selection object.

Parameters

Name

Required/Optional

Data Type

Description

Range

Required

Range

The range to compare with the current selection.

Return Value

Boolean

This method compares the starting and ending character positions and the story type. If all three of these items are the same for both the selection and the object specified by the Range argument, the objects are equal.

This example compares the selection with the second paragraph in the active document. If the selection isn't equal to the second paragraph, the second paragraph is selected.

If Selection.IsEqual(ActiveDocument _ 
 .Paragraphs(2).Range) = False Then 
 ActiveDocument.Paragraphs(2).Range.Select 
End If
Show:
© 2015 Microsoft