我发现当用户收到消息或点击发送按钮时会触发事件,但当用户创建空白的新电子邮件时不会触发任何事件。
问问题
598 次
1 回答
5
您应该能够使用 NewInspector 事件。例子:
Public WithEvents myOlInspectors As Outlook.Inspectors
Private Sub Application_Startup()
Initialize_handler
End Sub
Public Sub Initialize_handler()
Set myOlInspectors = Application.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
Dim msg As Outlook.MailItem
If Inspector.CurrentItem.Class = olMail Then
Set msg = Inspector.CurrentItem
If msg.Size = 0 Then
MsgBox "New message"
End If
End If
End Sub
于 2010-09-09T20:59:38.193 回答