Application.IsUndoingOrRedoing Property
Visio Automation Reference |
Determines whether the current event handler is being called as a result of an Undo or Redo action in the application. Read-only.
Version Information
Version Added: Visio 2000
Syntax
expression.IsUndoingOrRedoing
expression A variable that represents an Application object.
Return Value
Boolean
Remarks
The IsUndoingOrRedoing property returns True when the application is firing events related to an Undo or Redo action that the user has initiated in the user interface, or that an Automation client has initiated by calling the Undo or Redo method of an Application object.
When the application calls an event handler, the event has a "cause." If that cause is a user action or another event handler, it is legitimate to perform undoable actions during the course of handling that event. However, if the cause of the event firing is an Undo or Redo action, the event handler should not perform undoable actions. Doing so eliminates the ability to redo an action.
You will typically only perform undoable actions inside an event handler when this property is False. You can perform undoable actions when the flag is True, but the redo queue is destroyed.
Example
This example adds a shape to a drawing and then checks whether the shape has been added as a result of an Undo or Redo action.
Visual Basic for Applications |
---|
|
Visual Basic for Applications |
---|
|
See Also