method Surface.UndoRemoveAction ([Action as Variant], [Count as Variant])
Removes the last undo actions that can be performed on the surface.

TypeDescription
Action as Variant [optional] A long expression that specifies the action being remove. If missing or -1, all actions are removed. 

The Action parameter can be one of the following:

  • exUndoRedoAddElement(13) ~ "AddElement;ELEMENTID", indicates that a new element has been created
  • exUndoRedoRemoveElement(14) ~ "RemoveElement;ELEMENTID", indicates that an element has been removed
  • exUndoRedoMoveElement(15) ~ "MoveElement;ELEMENTID", indicates that an element has been moved or resized
  • exUndoRedoUpdateElement(16) ~ "UpdateElement;ELEMENTID", indicates that one or more properties of the element has been updated, using the StartUpdateElement / EndUpdateElement methods
  • exUndoRedoAddLink(10) ~ "AddLink;LINKID", indicates that a new link has been created
  • exUndoRedoRemoveLink(11) ~ "RemoveLink;LINKID", indicates that a link has been removed
  • exUndoRedoUpdateLink(12) ~ "UpdateLink;LINKID", specifies that one of more properties of the link has been updated, using the StartUpdateLink / EndUpdateLink methods

For instance, UndoRemoveAction(12) removes only AddElement actions from the undo stack.

Count as Variant [optional] A long expression that indicates the number of actions to remove. If missing or -1, all actions are removed. For instance, UndoRemoveAction(12,1) removes only the last AddElement action from the undo stack
Use the UndoRemoveAction method to remove the last action from the undo queue. Use the UndoRemoveAction() ( with no parameters ) to remove all undo actions. The RedoRemoveAction method removes the first action to be performed if the Redo method is invoked.  The AllowUndoRedo property enables or disables the Undo/Redo feature. The UndoListAction property lists the Undo actions that can be performed in the control. The RedoListAction property lists the Redo actions that can be performed in the control. The LayoutStartChanging(exUndo/exRedo) / LayoutEndChanging(exUndo/exRedo) event notifies your application whenever an Undo/Redo operation is performed.

The records of the Undo/Redo queue may contain actions in the following format:

Also, the Undo/Redo queue may include: