问题
I found events that fire when the user receives a message, or hits the send button, but nothing that fire when the user creates a blank, new email.
回答1:
You should be able to use the NewInspector event. Example:
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
来源:https://stackoverflow.com/questions/3674832/fire-an-outlook-2003-macro-when-the-user-creates-a-new-blank-message