本示例新建一篇文档,然后为其新添一个名为“myHeading”的段落样式,并以样式“标题 1”为新样式的基本样式。然后将新样式的左缩进量设置为 1 英寸(72 磅)。

Dim docNew As Document
Dim styleNew As Style
Set docNew = Documents.Add
Set styleNew = docNew.Styles.Add("NewHeading1")
With styleNew
    .BaseStyle = docNew.Styles(wpsStyleHeading1)
    .ParagraphFormat.LeftIndent = 72
End With