接受Word页眉,页脚和主要文档中的格式更改 [英] Accept Formatting Changes in Word Headers, Footers and Main Document

查看:264
本文介绍了接受Word页眉,页脚和主要文档中的格式更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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:

适用于所有HeadersFootersMain Document.

 ActiveDocument.AcceptAllRevisions

选项2

这只会Accept当前Document可见部分中的修订.

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

如果要查看特定的修订,只需遍历各个wdSeek选项以遍历各个部分.

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

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

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

ActiveDocument.Revisions.Item(x)

这篇关于接受Word页眉,页脚和主要文档中的格式更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆