Undo Method

Applies To

Document object.

Description

Undoes the last action or a sequence of actions, which are displayed in the Undo list. Returns True if the actions were successfully undone.

Syntax

expression.Undo(Times)

expression Required. An expression that returns a Document object.

Times Optional Variant. The number of actions to be undone.

See Also

Redo method, Repeat method, UndoClear method.

Example

This example undoes the last two actions taken in Sales.doc.

Documents("Sales.doc").Undo 2
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"