Accept Formatting Changes in Word Headers, Footers and Main Document

落爺英雄遲暮 提交于 2019-12-25 19:08:21

问题


I'm using the following VBA code to accept all formatting changes in a document. Which lines would I need to add in order to accept the changes in the Header and Footer as well?

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

回答1:


Option 1:

Works for all Headers and Footers and the Main Document.

 ActiveDocument.AcceptAllRevisions

Option 2

This will only Accept the revisions in the current viewable seciton of the Document.:

 ActiveDocument.Revisions.AcceptAll 

What you can then Add before is something like:

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

Just run through the various wdSeek Options to go through the various sections if you want to look at specific revisions.

You can also run a script on each revision using a Do or For Loop with:

ActiveDocument.Revisions.Item(x)



来源:https://stackoverflow.com/questions/33410229/accept-formatting-changes-in-word-headers-footers-and-main-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!