返回或设置 ParagraphFormat 对象,该对象代表指定区域、所选范围、查找与替换操作或样式中的段落设置。可读写。
本示例将当前所选段落的格式设置为右对齐。
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
本示例对包含 MyDoc.doc 所有内容的有关范围设置段落格式:2 倍行距,并且在 0.25 英寸的位置设置一个自定义制表位。
Set myRange = Documents("MyDoc.doc").Content
With myRange.ParagraphFormat
.Space2
.TabStops.Add Position:=InchesToPoints(.25)
End With
本示例修改活动文档的标题 2 样式。应用该样式的段落将根据第一个制表位缩进,并且采用 2 倍行距。
With ActiveDocument.Styles(wdStyleHeading2).ParagraphFormat
.TabIndent(1)
.Space2
End With
本示例查找活动文档中所有 2 倍行距的段落,并且将其设为 1.5 倍行距。
With ActiveDocument.Content.Find
.ClearFormatting
.ParagraphFormat.Space2
.Replacement.ClearFormatting
.Replacement.ParagraphFormat.Space15
.Execute FindText:="", ReplaceWith:="", _
Replace:=wdReplaceAll
End With