MS Word中是否有DocumentAfterPrint事件? [英] Is there a DocumentAfterPrint event in MS Word?
本文介绍了MS Word中是否有DocumentAfterPrint事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在一个项目中,在打印一个Word文档后,我需要将它恢复到某种状态.我发现了 DocumentBeforePrint事件,但我找不到查找一个DocumentAfterPrint事件. 文档记载不充分还是存在其他解决方法?
I am working on a project where I need to return a word document back to a certain state after it is printed. I have found a DocumentBeforePrint event but I cannot find a DocumentAfterPrint event. Is it poorly documented or is there some other workaround that exists?
推荐答案
Here is one workaround based on subroutine names. I do not believe there is a specific DocumentAfterPrint
event like you desire. Here's the code:
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
更新:请注意以下Will Rickards的答案中的陷阱.
UPDATE: Please note the gotchas in Will Rickards' answer below.
这篇关于MS Word中是否有DocumentAfterPrint事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文