setEndPoint Method

MS Office DHTML, HTML & CSS

 
Click to return to the DHTML, HTML & CSS home page    
setData Method     setExpression Method     DHTML Methods    

setEndPoint Method


Sets the end point of one range based on the end point of another range.

Syntax

textRange.setEndPoint(sType, oTextRange)

Parameters

sTypeRequired. String that specifies the end point to transfer, using one of the following values:
StartToEndMove the start of the TextRange object to the end of the specified oTextRange parameter.
StartToStartMove the start of the TextRange object to the start of the specified oTextRange parameter.
EndToStartMove the end of the TextRange object to the start of the specified oTextRange parameter.
EndToEndMove the end of the TextRange object to the end of the specified oTextRange parameter.
oTextRangeRequired. TextRange object that specifies the range from which the source end point is to be taken.

Return Value

No return value.

Remarks

A text range has two end points: one at the beginning of the text range and one at the end. An end point also can be the position between two characters in an HTML document.

In Microsoft® Internet Explorer 4.0, an end point is relative to text only, not HTML tags.

There are four possible end-point locations in the following HTML:

<BODY><P><B>abc

The possible end-point locations are:

  • Before the letter a.
  • Between the letters a and the b.
  • Between the letters b and the c.
  • After the letter c.

In Internet Explorer 4.0, an end point cannot be established between the BODY and the P, for example. Such an end point would be considered to occur before the letter a.

This method might not be available on non-Win32® platforms. For the latest information about Internet Explorer cross-platform compatibility, see article q172976Internet Link Non-MSDN link in the Microsoft Knowledge Base.

Example

This example uses the setEndPoint method to set the start point of the current range (r1) to the end point of the second range (r2).

<SCRIPT LANGUAGE="JScript">
r1.setEndPoint("StartToEnd", r2);
</SCRIPT>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.

TextRange


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.