【发布时间】:2019-06-04 16:06:20
【问题描述】:
所以在我的文档中,它会从 Access 中复制一些表格,然后将它们粘贴到 Word 中:
' Paste into word
wd.ActiveDocument.Sections(i).Range.Select
wd.Selection.Paste
然后它格式化表格,然后在最后插入一个分节符:
' Insert a new section
wd.ActiveDocument.Characters.Last.Select
wd.Selection.Collapse
wd.Selection.Range.InsertBreak Type:=wdSectionBreakNextPage
然后它重新开始循环:它从 Access 复制一个表并将其粘贴到新部分。我正在尝试更新这个新部分的标题,但它正在更新所有标题。
' Write to the header of this section
With wd.ActiveDocument.Sections(i).Headers(wdHeaderFooterPrimary).Range
.Text = Chr(10) & headerText
.Font.Size = 18
.Font.Name = "Tahoma"
.Font.Bold = True
.ParagraphFormat.SpaceBefore = 6
.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
关于我做错了什么的建议?
【问题讨论】:
-
.linktoprevious 应该是假的
-
是的,做到了。
-
@Freeflow 你想提供一个答案以便我接受吗?我不想因此而受到赞扬。