不要将通过VBA进行的更改添加到撤消历史记录中 [英] Don't add changes made via VBA to the undo history

查看:97
本文介绍了不要将通过VBA进行的更改添加到撤消历史记录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组Word宏,用于格式化从外部源发送到的文档.通常,对文档进行很多更改,所有更改都记录在撤消历史记录中,这是我不希望的.

I have a set of Word macro's that format documents that are sent to from an external source. Usually there are a lot of changes made to the document, all of which are recorded in the undo history, which I don't want.

是否有一种方法不将所有这些更改添加到撤消历史记录中,而是仅添加一个撤消操作来撤消宏已完成的所有操作?谢谢.

Is there a way to not add all of these changes to the undo history, but rather just add one undo action that will undo everything the macros have done? Thanks.

推荐答案

此功能不适用于Word 2007或更早版本. Word 2010中添加了UndoRecord对象,使您可以将在VBA中执行的操作聚集"到单个UndoRecord中,可以为其中的Undo列表分配自定义标签".撤消操作可以嵌套在各个级别.可以创建多个UndoRecord对象. MSDN文档中提供了更多信息

This is not available for Word 2007 or earlier. The UndoRecord object was added in Word 2010 and lets you "clump" actions made in VBA into a single UndoRecord, to which a custom "label" for the Undo list can be assigned. The Undo actions can be nested at various levels. More than one UndoRecord object can be created. More information is available in the MSDN documentation

https://msdn. microsoft.com/en-us/library/office/ff821168(v=office.14).aspx

这篇关于不要将通过VBA进行的更改添加到撤消历史记录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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