【发布时间】:2022-01-06 00:07:13
【问题描述】:
我使用此方法添加文本,但它在左侧对齐。 如何使其成为文档中心?
With ActiveDocument.Content
.InsertAfter "hello world!"
End With
【问题讨论】:
我使用此方法添加文本,但它在左侧对齐。 如何使其成为文档中心?
With ActiveDocument.Content
.InsertAfter "hello world!"
End With
【问题讨论】:
新的段落是文档的最后一个>>使用.paragraphs.last
Sub test()
With ActiveDocument.Content
.InsertParagraphAfter 'to be safe that new content is on its own para = last para of document
.InsertAfter "hello world!"
.Paragraphs.Last.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
End Sub
``
【讨论】: