Best way to start a program when specific email received?
On Wed, 31 Jan 2007 19:06:08 -0500, "Ken Slovak - [MVP - Outlook]"
wrote:
You can prototype your code as a macro that runs automatically in the
Outlook VBA. It would be put in the ThisOutlookSession class.
Dim WithEvents colItems As Outlook Items
Private Sub Application_Startup()
Dim oNS As Outlook.NameSpace
Set oNS = Application.GetNameSpace("MAPI")
Set colItems = oNS.GetDefaultFolder(olFolderInbox)
End Sub
Then just select colItems in the left drop-down, ItemAdd in the right
drop-down and the prototype of the event handler will be added to the class.
The next time you start Outlook it will run for every new item (for 15 or
fewer items at a time). Make sure your macro security is set to allow the
macro to run.
Thank you.
|