createTextRange Method

Microsoft FrontPage Visual Basic

createTextRange Method

Returns an IHTMLTxtRange object that represents a range of text and elements in a document.

expression.createTextRange

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

The following example searches the active document for the specified text, and then selects the text if it is found.

    Dim objRange As IHTMLTxtRange
Dim blnFound As Boolean

Set objRange = ActiveDocument.body.createTextRange
blnFound = objRange.findText("search text")
If blnFound = True Then objRange.Select