Don't add changes made via VBA to the undo history

懵懂的女人 提交于 2019-12-07 06:34:56

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/14832053/dont-add-changes-made-via-vba-to-the-undo-history

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