Hi dmkAlex,
> CODE
> Public WithEvents myOlApp As Outlook.Application
>
> Sub Initialize_handler()
> Set myOlApp = CreateObject("Outlook.Application")
> End Sub
>
> Private Sub myOlApp_NewMail()
> Dim myExplorers As Outlook.Explorers
> Set myExplorers = myOlApp.Explorers
> Dim myItem As Outlook.MailItem
>
> Set myItem = myOlApp.ActiveInspector.CurrentItem
> If myItem.Subject = "Testing" Then
> MsgBox "This message is a test message."
> End If
>
> End Sub
>
> When I receive a new email, it doesn't seem to activate this block of
> routine.
>
> What am I doing wrong?
You don't need an additional Application object in Outlook VBA.
Open the VBA editor. Select Application in the top left combobox.
Select NewMail from the top right combobox. Put your
myOlApp_NewMail code in that event handler.
Your above approach would only be necessary when you code runs
outside of Outlook.
--
SvenC