Partager via


Selection.SelectCurrentIndent Method (Word)

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

Syntax

expression .SelectCurrentIndent

expression Required. A variable that represents a Selection object.

Example

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

See Also

Concepts

Selection Object

Selection Object Members