Sets the endpoint of one range based on the endpoint of another range.
Syntaxvar retval = TextRange.setEndPoint(how, SourceRange);
- how [in]
String that specifies the endpoint to transfer using one of the following values.
Move the start of the TextRange object to the end of the specified SourceRange parameter.
Move the start of the TextRange object to the start of the specified SourceRange parameter.
Move the end of the TextRange object to the start of the specified SourceRange parameter.
Move the end of the TextRange object to the end of the specified SourceRange parameter.
- SourceRange [in]
TextRange object from which the source endpoint is to be taken.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
There are no standards that apply here.
A text range has two endpoints: one at the beginning of the text range and one at the end. An endpoint can also be the position between two characters in an HTML document.
There are four possible endpoint locations in the following HTML.
The possible endpoint locations are:
- Before the letter a.
- Between the letters a and b.
- Between the letters b and c.
- After the letter c.
This feature might not be available on platforms other than Microsoft Win32.
In Microsoft Internet Explorer 4.0, an endpoint is relative to text only, not HTML tags.
The following example shows how to use the setEndPoint method to set the start point of the current range (
r1) to the endpoint of the second range (