Share via


createRange Method

Returns an IHTMLTxtRange object that represents a selection of text in a document.

expression.createRange

*expression   * Required. An expression that returns an IHTMLSelectionObject object.

Example

The following example creates a range from the currently selected text in the active document.

Dim objRange As IHTMLTxtRange

Set objRange = ActiveDocument.selection.createRange

Applies to | IHTMLSelectionObject Object