Document.Undo Method
Publisher Developer Reference |
Undoes the last action or a specified number of actions. Corresponds to the list of items that appears when you click the arrow beside the Undo button on the Standard toolbar.
Syntax
expression.Undo(Count)
expression A variable that represents a Document object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Count | Optional | Long | Specifies the number of actions to be undone. Default is 1, meaning that if omitted, only the last action will be undone. |
Remarks
If called when there are no actions on the undo stack, or when Count is greater than the number of actions that currently reside on the stack, the Undo method will undo as many actions as possible and ignore the rest.
The maximum number of actions that can be undone in one call to Undo is 20.
Example
The following example uses the Undo method to undo actions that do not meet specific criteria.
Part 1 of the example adds a rectangular callout shape to the fourth page of the active publication, and text is added to the callout. This process creates three actions.
Part 2 of the example tests whether the font of the text added to the callout is Verdana. If not, then the Undo method is used to undo all available actions (the value of the UndoActionsAvailable property is used to specify that all actions be undone). This clears all actions from the stack. A new rectangle shape and text frame are then added and the text frame is populated with Verdana text.
Visual Basic for Applications |
---|
|
See Also