Selection.SelectCurrentIndent 方法 (Word)

向前扩展选定内容,直至遇到具有另一种段落左右缩进量的文本为止。

语法

expression. SelectCurrentIndent

expression:必需。 表示 Selection 对象的变量。

示例

本示例跳转到活动文档中与活动文档的第一段的段落缩进量不同的第一个段落的开始。

With Selection 
 .HomeKey Unit:=wdStory, Extend:=wdMove 
 .SelectCurrentIndent 
 .Collapse Direction:=wdCollapseEnd 
End With

本示例判断活动文档中的所有段落的段落左或右缩进量是否相同,然后在一个消息框显示判断结果。

With Selection 
 .HomeKey Unit:=wdStory, Extend:=wdMove 
 .SelectCurrentIndent 
 .Collapse Direction:=wdCollapseEnd 
End With 
If Selection.End = ActiveDocument.Content.End - 1 Then 
 MsgBox "All paragraphs share the same left " _ 
 & "and right indents." 
Else 
 MsgBox "Not all paragraphs share the same left " _ 
 & "and right indents." 
End If

另请参阅

Selection 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。