Document.Undo method (Word)
Undoes the last action or a sequence of actions, which are displayed in the Undo list. Returns True if the actions were successfully undone.
expression Required. A variable that represents a Document object.
|Times||Optional||Variant||The number of actions to be undone.|
This example undoes the last two actions taken in Sales.doc.
This example undoes the last action. If the action is successfully undone, a message is displayed in the status bar.
On Error Resume Next If ActiveDocument.Undo = False Then _ StatusBar = "Undo was unsuccessful"
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.