|Publisher Developer Reference|
expression A variable that represents a Document object.
|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.|
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.
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|