outlook event newMail (newItem)

5.8k views Asked by At

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)

1

There are 1 answers

5
JimmyPena On BEST ANSWER

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