This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.
I have added some table management to the html editor. My problem is that when I for instance add a row to the table and press undo that he deletes the cells one by one and that is not what I want. Is there a way to add my table actions to the undo list of mshtml???
You'll need to implement IOleUndoUnit and IOleUndoManager and pack multiple undo steps into one unit which is recalled with the UNDO command internally. There are several sources on the internet about these interfaces.
You can find a working solution within our .NET editor control:
is there a way to avoid that some actions (my insert cells) will be inserted in the undo list?
I want 5 actions replaced by 1 action in the undo list. Is this possible?
Thx!
The principle is that you pack any number of undo steps into one call of the undo function. I've not found any way to avoid a specific step to be not packed in a usable piece of code.
And yes, for table actions it works very fine. You must also remember that inserting 5 cells does not result in 5 steps, because you insert the row plus 5 cells (6 steps) and maybe some additional actions to handle rowspan or colspan, content of cells and much more.
Again, the way is not to avoid inserting undo steps, but packing them together. The interfaces have appropriate methods for that.