Table of contents
TOC
折叠目录
展开目录

Document.Selection 属性 (发布服务器)Document.Selection Property (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回一个表示选定的区域或光标选择对象。Returns a Selection object that represents a selected range or the cursor.

语法Syntax

表达式所选内容expression. Selection

_expression_A 表示一个文档对象的变量。_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.

Sub Selectable() 

 If Selection.Type = pbSelectionText Then MsgBox Selection.TextRange 

End Sub
© 2018 Microsoft