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

createRangeCollection method

Creates a TextRange object collection from the current selection.

Syntax


 retVal = object.createRangeCollection();

Parameters

This method has no parameters.

Standards information

There are no standards that apply here.

Remarks

Host applications can provide a multiple selection mechanism and can return a collection of TextRange objects that represents discontinuous selections.

The host application provides the collection through the ISegmentList interface. MSHTML requests this interface through the ISelectionServices interface.

Microsoft Internet Explorer 5.5 does not provide multiple selection. The default implementation of this method returns a collection consisting of a single TextRange object.

Examples

The following example displays the text of the first selected item.


var myCollection;
myCollection = document.selection.createRangeCollection();
alert( myCollection.item(0).text );


See also

ISelectionServices
ISegmentList

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.