问题
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