I'm working with outlook 2003

I search a way to get the event when a new mail is created (when the window of new mail is created)

Note: I search every way to add a menu to new mail window)

有帮助吗?

解决方案

This sample code should be placed in the ThisOutlookSession module. Restart Outlook and whenever you create a new email you will see the message box.

Private WithEvents objinspectors As Outlook.Inspectors

Private Sub Application_Startup()
  Set objinspectors = Application.Inspectors
End Sub

Private Sub objinspectors_NewInspector(ByVal Inspector As Inspector)
  If TypeName(Inspector.CurrentItem) = "MailItem" Then
    MsgBox "newinspector"
  End If
End Sub
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top