Share via


Selection.SelectCurrentIndent メソッド (Word)

左インデント幅または右インデント幅の異なる文字列まで、選択範囲を文書の末尾方向に拡張します。

構文

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 のサポートおよびフィードバックを参照してください。