Document.BeginCustomUndoAction Method
Publisher Developer Reference |
Specifies the starting point and label (textual description) of a group of actions that are wrapped to create a single undo action. The EndCustomUndoAction method is used to specify the endpoint of the actions used to create the single undo action. The wrapped group of actions can be undone with a single undo.
Syntax
expression.BeginCustomUndoAction(ActionName)
expression A variable that represents a Document object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
ActionName | Required | String | The label that corresponds to the single undo action. This label appears when you click the arrow beside the Undo button on the Standard toolbar. |
Remarks
The following methods of the Document object are unavailable within a custom undo action. A run-time error is returned if any of these methods are called within a custom undo action:
- Document.Close
- Document.MailMerge.DataSource.Close
- Document.PrintOut
- Document.Redo
- Document.Save
- Document.SaveAs
- Document.Undo
- Document.UndoClear
- Document.UpdateOLEObjects
The BeginCustomUndoAction method must be called before the EndCustomUndoAction method is called. A run-time error is returned if EndCustomUndoAction is called before BeginCustomUndoAction.
Nesting a custom undo action within another custom undo action is allowed, but the nested custom undo action has no effect. Only the outermost custom undo action is active.
Example
The following example contains two custom undo actions. The first one is created on the first page of the active publication. The BeginCustomUndoAction method is used to specify the point at which the custom undo action should begin. Six individual actions are performed, and then they are wrapped into one action with the call to EndCustomUndoAction.
The text in the text frame that was created within the first custom undo action is then tested to determine whether the font is Verdana. If not, the Undo method is called with UndoActionsAvailable passed as a parameter. In this case there is only one undo action available. So, the call to Undo Method will undo only one action, but this one action has wrapped six actions into one.
A second undo action is then created, and it could also be undone later with a single undo operation.
Visual Basic for Applications |
---|
|
See Also