【问题标题】:Interop, undo all actions in word undo stack互操作,撤消 word 撤消堆栈中的所有操作
【发布时间】:2010-09-08 10:00:31
【问题描述】:

我正在使用 c# 和 word 互操作。 如何以编程方式撤消 Word 撤消堆栈中的所有操作?

问候。

【问题讨论】:

    标签: ms-word office-interop


    【解决方案1】:

    解决办法如下:

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

    但在调用此代码之前,必须删除 ContentControlBeforeDelete、ContentControlOnEnter 和 ContentControlOnExit 等代码字事件处理程序,否则字会冻结(http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/50a96ba1-85e3-498f-89bb-4181220a565f)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-03
      • 1970-01-01
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-11
      相关资源
      最近更新 更多