如果该属性值为 True,则当 Word 自动设置文档或区域格式时,保留先前所用的样式。Boolean 类型,可读写。
本示例中,先设置 Word,使其可保留原有样式,并自动设置标题、列表和其他段落的样式,然后 Word 自动设置当前所选内容的格式。
With Options
.AutoFormatPreserveStyles = True
.AutoFormatApplyHeadings = True
.AutoFormatApplyLists = True
.AutoFormatApplyOtherParas = True
End With
Selection.Range.AutoFormat
本示例返回“工具”菜单的“自动更正”对话框的“自动套用格式”选项卡中的“样式”选项的状态。
Dim blnAutoFormat as Boolean
blnAutoFormat = Options.AutoFormatPreserveStyles