代码之家  ›  专栏  ›  技术社区  ›  wusher

MS Word中是否有DocumentAfterPrint事件?

  •  1
  • wusher  · 技术社区  · 17 年前

    我正在做一个项目,在这个项目中,我需要在打印后将word文档恢复到某种状态。我找到了一个 DocumentBeforePrint event 它的记录是否很差,或者是否存在其他解决方法?

    3 回复  |  直到 17 年前
        1
  •  2
  •   Daniel F. Thornton    17 年前

    one workaround 基于子程序名称。我不相信有一个具体的 DocumentAfterPrint 如你所愿的活动。代码如下:

    Sub FilePrint()
    'To intercept File > Print and CTRL-P'
    
    MyPrintSub
    
    End Sub
    
    Sub FilePrintDefault()
    'To intercept the Standard toolbar button'
    
    MyPrintSub
    
    End Sub
    
    Sub MyPrintSub()
    
    Dialogs(wdDialogFilePrint).Show
    'Your code here, e.g:'
    MsgBox "I am done printing."
    
    End Sub
    

        2
  •  1
  •   Will Rickards    17 年前

    我也没有在文档事件中看到它。 this site 此外,后台打印可能会导致代码在打印完成之前执行。如果你真的必须在打印后运行某个东西,你需要 disable background printing .

        3
  •  0
  •   Himanshu THE ONLY ONE    13 年前

    我不相信任何建议的解决方法在Word 2010中都有效。然而,我通过使用 application.onTime() documentBeforePrint