ShrinkDiscontiguousSelection 方法

       

当所选内容包括多个不连续的选定内容时,取消全部选定,只保留最近选定的文本。

expression.ShrinkDiscontiguousSelection

expression   必需。该表达式返回一个 Selection 对象。

示例

本示例取消全部选定,只保留最近选定的文本和选定内容中加粗格式文本和小型大写字母文本。本示例假定文档中有多处选定内容。

Sub ShrinkMultipleSelection()
    With Selection
        .ShrinkDiscontiguousSelection
        .Font.Bold = True
        .Font.SmallCaps = True
    End With
End Sub