Selection 属性

       

返回一个 Selection 对象,该对象代表指定文档窗口中选定项。只读。

示例

如果在活动窗口中选定了文本,本示例将该文本设为倾斜。

With Application.ActiveWindow.Selection
    If .Type = ppSelectionText Then
        .TextRange.Font.Italic = True
    End If
End With