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

Selection.IsEqual Method (Word)

Published: July 16, 2012

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.