COM Add-In for Outlook HELP

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
 
K

Ken Slovak - [MVP - Outlook]

Check out the application-wide ItemSend event for sending and ItemAdd
on the Items collection of the Inbox for receiving.

Also, download and study various best practices for COM addins for
Outlook in the ItemsCB sample on the Resources page at
www.microeye.com
 
B

Brian Tillman

Rafael Chemtob said:
I am currently using another COM add-in to navigate users to "Outlook
Today" when they launch Outlook.

Why, when that option already exists in Tools>Options>Other>Advanced
Options?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top