Hi!
I have recently been doing something pretty much along these lines; I'm posting what I have that I believe is relevant for you. All the code is in the ThisOutlookSession in the VBA editor.
-------- 8< --------
Public WithEvents objInbox As Outlook.Items
Private Sub Application_Startup()
Set objInbox = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Sub DoStuff(ByRef Item As Outlook.MailItem)
MsgBox "Subject: " & Item.Subject & ", sender: " & Item.SenderEmailAddress
End Sub
Private Sub objInbox_ItemAdd(ByVal Item As Object)
If Item.Class = olMail Then
DoStuff Item
End If
End Sub
-------- 8< --------
Two links regarding what I do above:
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
Hopefully this will get you started!
///BR, Jens Carlberg