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