Take the 2-minute tour ×

I am using c# and word interop. How can I, programmatically, undo all actions in word undo stack?


share|improve this question
add comment

1 Answer

Here is the solution :

object times = 1;
while (worDocument.Undo(ref times))

But before calling this code word event handlers like ContentControlBeforeDelete, ContentControlOnEnter and ContentControlOnExit must be removed otherwise word freezes(http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/50a96ba1-85e3-498f-89bb-4181220a565f).

share|improve this answer
add comment

Your Answer


