Selection.SelectCurrentIndent Method (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Extends the selection forward until text with different left or right paragraph indents is encountered.

expression .SelectCurrentIndent

expression Required. A variable that represents a Selection object.

This example jumps to the beginning of the first paragraph in the document that has different indents than the first paragraph in the active document.

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

This example determines whether all the paragraphs in the active document are formatted with the same left and right indents and then displays a message box indicating the result.

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
Show: