Share via


Document.Selection Property

Publisher Developer Reference

Returns a Selection object that represents a selected range or the cursor.

Syntax

expression.Selection

expression   A variable that represents a Document object.

Example

This example tests whether the current selection is text. If it is text, the selected text is then displayed in a message box.

Visual Basic for Applications
  Sub Selectable()
If <strong>Selection</strong>.Type = pbSelectionText Then MsgBox <strong>Selection</strong>.TextRange

End Sub

See Also