Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Clearing the Undo Stack in a Macro.
by Allen Wyatt
(last updated October 11, 2014)
Normally, as you are making edits in your documents, Word keeps track of what you do. Word does this so you can later use the Undo and Redo commands on the toolbar. What if you are developing a macro, however, and you don't want the user to be able to undo changes? In this case, you can use the UndoClear method in your macro, as follows:
In this usage, UndoClear wipes out the Undo stack (the list of actions that is remembered by Word) for the active document. Note that this affects only those actions that have been recorded so far; any new actions will be duly recorded and available on the stack.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13275) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Clearing the Undo Stack in a Macro.
Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!
Macros are part of the document and template that are loaded into memory when you open a file. If you have "junk" macros ...Discover More
If you are applying formatting from within a macro, you may want to change the alignment of various paragraphs. Here's ...Discover More
Bookmarks can be very handy in a document. Word provides a VBA command you can use to easily select any of those bookmarks.Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.