IHTMLTxtRange Object

Microsoft FrontPage Visual Basic

IHTMLTxtRange Object

IHTMLTxtRange

Represents a range or selection of text and elements in an HTML document.

Using the IHTMLTxtRange object

Use the createTextRange method of the FPHTMLBody object to return an IHTMLTxtRange object. The following example creates a range that includes the entire body of the active document, and then selects the entire document.

    Dim objRange As IHTMLTxtRange

Set objRange = ActiveDocument.body.createTextRange

objRange.Select
  

Use the createRange method of the IHTMLSelectionObject object to return an IHTMLTxtRange object that represents the currently selected text and elements in the active document. The following example creates a range from the current selection in the active document.

    Dim objRange As IHTMLTxtRange

Set objRange = ActiveDocument.selection.createRange