我正在使用以下 VBA 代码在保存 Word 文档时显示一个消息框,
Public WithEvents appWord as Word.Application
Private Sub appWord_DocumentBeforeSave _
(ByVal Doc As Document, _
SaveAsUI As Boolean, _
Cancel As Boolean)
Dim intResponse As Integer
intResponse = MsgBox("Do you really want to " _
& "save the document?", _
vbYesNo)
If intResponse = vbNo Then Cancel = True
End Sub
这段代码是在一个类中编写的。但这不起作用。保存时没有任何反应。这里有什么问题?