TextRange.findText() (Method)

Defines a text range according to a search.


JScript - 3.0
Internet Explorer - 4.0
Property/method value type:TextRange object
JavaScript syntax:IEmyTextRange.findText(aString)
Argument list:aStringA string to find in the TextRange object

This is a case-insensitive search for a matching text. If the text is located, then the start and end points of the TextRange object are adjusted to encapsulate the found text chunk.

The TextRange needs to be collapsed for this to work. It could be collapsed and made to point at the start of the document if you want to search the whole text, otherwise the search commences at the current insertion point.

This method returns a Boolean true if it found a match and a Boolean false if it didn't.