【问题标题】:Accept Formatting Changes in Word Headers, Footers and Main Document接受 Word 页眉、页脚和主文档中的格式更改
【发布时间】:2015-11-05 23:32:18
【问题描述】:

我正在使用以下 VBA 代码来接受文档中的所有格式更改。我需要添加哪些行才能同时接受页眉和页脚中的更改?

ActiveDocument.ShowRevisions = True
ActiveDocument.ActiveWindow.View.ShowFormatChanges = True
ActiveDocument.ActiveWindow.View.ShowComments = False
ActiveDocument.ActiveWindow.View.ShowInsertionsAndDeletions = False
ActiveDocument.ActiveWindow.View.ShowInkAnnotations = False
ActiveDocument.AcceptAllRevisionsShown
ActiveDocument.ActiveWindow.View.ShowComments = True
ActiveDocument.ActiveWindow.View.ShowInsertionsAndDeletions = True
ActiveDocument.ActiveWindow.View.ShowFormatChanges = True
ActiveDocument.ActiveWindow.View.ShowInkAnnotations = True

【问题讨论】:

    标签: vba ms-word


    【解决方案1】:

    选项 1:

    适用于所有 HeadersFooters 以及 Main Document

     ActiveDocument.AcceptAllRevisions
    

    选项 2

    这只会AcceptDocument 的当前可见部分中的修订。:

     ActiveDocument.Revisions.AcceptAll 
    

    您可以在之前添加的内容类似于:

    'Opening the Header
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    

    如果您想查看特定的修订,只需运行各种 wdSeek 选项以浏览各个部分。

    您还可以使用 DoFor Loop 在每个修订版上运行脚本:

    ActiveDocument.Revisions.Item(x)

    【讨论】:

      猜你喜欢
      • 2019-03-19
      • 1970-01-01
      • 2013-03-09
      • 2017-05-26
      • 1970-01-01
      • 1970-01-01
      • 2021-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多