Instructs the undo manager to invoke undo actions back through the undo stack, down to and including the specified undo unit.
HRESULT UndoTo(
IOleUndoUnit* pUU //Pointer to the top level unit to undo
);
This method calls the IOleUndoUnit::Do method on each top-level undo unit. Then, it releases that undo unit.
Note that the specified undo unit must be a top-level unit, typically retrieved through IOleUndoManager::EnumUndoable.
In case an error is returned from the undo unit, the undo manager needs to attempt to rollback the state of the document to recover from the error by performing actions on the redo stack.
No matter what the success of the rollback, the undo manager should always clear both stacks before returning the error.
If the undo manager has called the Do method on more than one top-level unit, it should only rollback the unit that returned the error. The top-level units that succeeded should not be rolled back.
The undo manager must also keep track of whether or not units were added to the opposite stack so it won't attempt rollback if nothing was added. See the IOleUndoManager interface for detailed description of error handling.
Windows NT: Use version 4.0 or later. New for OC96.
Windows: Use Windows 95 or later. New for OC96.
Windows CE: Unsupported.
Header: Declared in ocidl.h.
IOleUndoManager::EnumUndoable, IOleUndoManager::RedoTo, IOleUndoUnit::Do