TextRange.compareEndPoints Method
SharePoint Designer Developer Reference |
Compares an end point of an TextRange object with an end point of another TextRange object. Returns a Long that represents the comparison of the specified points.
Syntax
expression.compareEndPoints(how, SourceRange)
expression Required. A variable that represents an TextRange object.
Parameters
Name | Required/Optional | Data Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
how | Required | String | String. Specifies how the two TextRange objects are to be compared. May be one of the following four values.
|
||||||||||||||
SourceRange | Required | TextRange | The range with which to compare the initial range specified. |
Remarks
The Long value returned for the compareEndPoints method can be one of the following values.
Value | Description |
---|---|
-1 | The end point of the object is to the right of the end point of the TextRange object specified in the SourceRange parameter. |
0 | The end point of the object is at the same location as the end point of of the TextRange object specified in the SourceRange parameter. |
1 | The end point of the object is to the left of the end point of of the TextRange object specified in the SourceRange parameter. |
Example
The following example compares the selected range with the document and displays a message stating whether the selected range is at the beginning of the document or the end of the document.
Visual Basic for Applications |
---|
|
See Also