从PowerPoint VBA创建3列Word页脚

从PowerPoint VBA创建3列Word页脚,vba,ms-word,powerpoint,footer,multiple-columns,Vba,Ms Word,Powerpoint,Footer,Multiple Columns,我正在从PowerPoint创建Word文档,在表格中复制幻灯片等。 然后我做了一个如下的页脚: Const wdSeekCurrentPageFooter = 10 Const wdFieldEmpty = -1 ... wrdApp.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter wrdApp.Selection.TypeText Text:="Column1" & " " & CStr(Date

我正在从PowerPoint创建Word文档,在表格中复制幻灯片等。 然后我做了一个如下的页脚:

Const wdSeekCurrentPageFooter = 10
Const wdFieldEmpty = -1
...
wrdApp.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
wrdApp.Selection.TypeText Text:="Column1" & " " & CStr(Date) & " " & "Page "
wrdApp.Selection.Fields.Add Range:=wrdApp.Selection.Range, _
Type:=wdFieldEmpty, Text:="PAGE  ", PreserveFormatting:=True
wrdApp.Selection.TypeText Text:=" of "
wrdApp.Selection.Fields.Add Range:=wrdApp.Selection.Range, _
Type:=wdFieldEmpty, Text:="NUMPAGES  ", PreserveFormatting:=True
所以我在页脚中得到了3个信息,但我可以使用标签使它们看起来很好,我想

  • 手动添加页脚、内置、空白(三列)或

  • 页脚,插入3个文本,编辑,插入对齐选项卡

但我无法从PowerPoint VBA中使用这两个解决方案中的任何一个

  • 在模板中循环时,我看不到“Building Blocks.dotx”

  • 此代码中断(未找到命名参数)


  • 我需要2007年、2010年和2013年在办公室工作的解决方案。您知道如何实现这一点吗?

    InsertAlignment选项卡只有两个参数,对齐和相对到(非相对)

    为了让VBA“看到”参数的名称,您需要 对Word对象模型的引用(工具->引用…)。但是自从 您的目标是多个版本的Office,您可能 试图避免这种情况,在这种情况下,请使用位置参数 通过

    wrdApp.Selection.Range.InsertAlignmentTab 0, 0
    
    re。对于构建块循环,我猜您不能保证buildingblocks.dotx存在

    wrdApp.Selection.Range.InsertAlignmentTab 0, 0