Table of contents
Collapse the table of content
Expand the table of content

Document.Selection Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

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


expression. Selection

_expression_A variable that represents a Document object.


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

Sub Selectable() 

 If Selection.Type = pbSelectionText Then MsgBox Selection.TextRange 

End Sub
© 2018 Microsoft