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.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
If you write a macro that makes changes to a document, you may want that macro to save those changes. There are several ways ...Discover More
There are a myriad of ways in which a date can be formatted—day first, month first, number of digits in the year, etc. ...Discover More
Inserting a break in your document is easy. You may think that inserting one using a macro is more complex, but it isn't. ...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.