0
我想创建App_DocumentBeforeClose。App_DocumentBeforeClose vba word
在的ThisDocument:
Private Sub Document_Open()
start
End Sub
在MODUL
Sub start()
Dim X As New EventClassModule
Set X.App = Word.Application
End Sub
在课堂Mudel:
我用这个代码中使用
Public WithEvents App As Word.Application
Private Sub App_DocumentBeforeClose(ByVal Doc As Document, Cancel As
Boolean)
MsgBox "App_DocumentBeforeClose"
End Sub
当我关闭文档这不是让我看看MsgBox ,为什么?
感谢,
塔尔
你必须实例化类:https://msdn.microsoft.com/en-us/library/office/ff821218.aspx#Initialize – Absinthe