R
Rafael Chemtob
Hi,
I am building a COM add-in for Outlook to check the subject and body of
e-mails as they arrive for certain values.
I am currently using another COM add-in to navigate users to "Outlook Today"
when they launch Outlook. The code looks like the following:
***************************
Dim objOL As Outlook.Application
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal
ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As
Object, custom() As Variant)
If Not Application Is Nothing Then
Set objOL = Application
Dim objFolder As Outlook.MAPIFolder
Set objFolder = objOL.Session.GetDefaultFolder(olFolderInbox).Parent
If Not objFolder Is Nothing Then
If objOL.Explorers.Count > 0 Then
Set objOL.ActiveExplorer.CurrentFolder = objFolder
End If
End If
Set objOL = Nothing
End If
End Sub
**************************
the code executes when users launch outlook. I need to have a method called
when users send and receive e-mails.
Please advise.
Rafael
I am building a COM add-in for Outlook to check the subject and body of
e-mails as they arrive for certain values.
I am currently using another COM add-in to navigate users to "Outlook Today"
when they launch Outlook. The code looks like the following:
***************************
Dim objOL As Outlook.Application
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal
ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As
Object, custom() As Variant)
If Not Application Is Nothing Then
Set objOL = Application
Dim objFolder As Outlook.MAPIFolder
Set objFolder = objOL.Session.GetDefaultFolder(olFolderInbox).Parent
If Not objFolder Is Nothing Then
If objOL.Explorers.Count > 0 Then
Set objOL.ActiveExplorer.CurrentFolder = objFolder
End If
End If
Set objOL = Nothing
End If
End Sub
**************************
the code executes when users launch outlook. I need to have a method called
when users send and receive e-mails.
Please advise.
Rafael