There's actually three kinds of events that can be triggered when an e-mail
is delivered to your Inbox:
- the Application_NewMail event fires, but does not tell you what has been
received - not usually very helpful
- if you use Exchange, the Application_NewMailEx event passes a string of
comma-delimited EntryID values that can be used with the GetItemFromID method
to retrieve those items
- you can also hook up an Item_Add event to a MAPIFolder object hooked up to
your Inbox, which passes the singular object that was added; will fire once
for every item that comes in, but is NOT very reliable if a large number of
items are delivered/created
This link documents the last method, and you can find sample code from the
others in the Events hierarchy:
ItemAdd Event [Outlook 2003 VBA Language Reference]:
http://msdn.microsoft.com/library/en-us/vbaol11/html/olevtItemAdd_HV05254252.asp?frame=true