isEqual Method

Microsoft FrontPage Visual Basic

object specified in the range argument is the same as the original IHTMLTxtRange object.

expression.isEqual(range)

expression    Required. An expression that returns an IHTMLTxtRange object.

range    Required IHTMLTxtRange object.

Example

The following example takes an IHTMLTxtRange object, checks it against the current selection, and returns True if the two ranges are the same.

Function RangeIsEqual(objRange As IHTMLTxtRange) As Boolean
    Dim objSelection As IHTMLTxtRange
    
    Set objSelection = ActiveDocument.Selection.createRange
    
    If objRange.IsEqual(objSelection) = False Then
        RangeIsEqual = False
    Else
        RangeIsEqual = True
    End If
End Function
		

Use the following example to call the preceding function.

Sub CallRangeIsEqual()
    Dim objRange As IHTMLTxtRange
    
    Set objRange = ActiveDocument.body.createTextRange
    
    MsgBox RangeIsEqual(objRange)
End Sub