I don't think there's an easy way to clear the global undo stack. I don't
think that's a good idea anyway...
For the current operation though you can use set your own UndoContext and
then decide to abort the Undo buffer like this:
try // Make sure UndoContext gets cleaned up ALWAYS!
{
this.applicationObject.UndoContext.Open("Insert XML Comment from Help
Builder", false);
// *** Insert the XML From our Element
if !this.AddInHelper.InsertXmlComment(Comment, Element)
this.applicationObject.UndoContext.SetAborted();
}
finally
{
this.applicationObject.UndoContext.Close();
}
You can set a current UndoContext and then optionally abort it so whatever
you do basically never ends up in the UndoBuffer.
+++ Rick ---

Signature
Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
> Dear all,
> I do some changes in an active document. Sometimes I have call undo to
[quoted text clipped - 3 lines]
> Thanks a lot.
> Boni
Boni - 31 Oct 2005 11:49 GMT
Dear Sir,
thanks for an advice. I already tried this solution, it does not fit my
needs. I need to undo my changes in document (in the mentioned cases) and
need that this changes don't apear in redo stack.
> I don't think there's an easy way to clear the global undo stack. I don't
> think that's a good idaea anyway...
[quoted text clipped - 29 lines]
>> Thanks a lot.
>> Boni
> I do some changes in an active document. Sometimes I have call undo
> to remove those changes. After that the appropriate action is visible
> in a redo stack. Do I have a chance to remove it from there or at
> least completely clear undo and redo stack? Thanks a lot. Boni
The only way that I can think of to do this is to create your own
custom undo object that implements IOleParentUndoUnit. If you do this,
you can collect the text changes within your object and then you have
complete control over the creation of your object on the redo stack. If
you aren't familiar with this interface, there is great information in
the Platform SDK.

Signature
Best Regards,
Dustin Campbell
Developer Express, Inc