Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
253 views
Welcome To Ask or Share your Answers For Others

1 Answer

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...