Link to home
Start Free TrialLog in
Avatar of andrew_e
andrew_e

asked on

New Mail Notication (how to detect)

Okay, I'm VERY new at Outlook programming, but have no problem with Visual Basic programming.

I want to write either a stand-alone program or internal module that will DETECT a new mail and then kick on an appropriate method.  In other words, I want Outlook to automatically detect & then check the details of an incoming e-mail and react accordingly (if its the e-mail that supposed to be processed).  PLEASE, can anybody tell me how I can do this.
Avatar of Neo_mvps
Neo_mvps

The solution to your problem depends on the mode and version of Outlook.  For example, Outlook 2000 is the first client to have an extensive VBA model that can notify a COM Object of an event like new mail or an addition of an item to a folder.

If using a previous version or Windows Messaging, then one must rely on C++ development and the IEXCH and MAPI events. (Not to many books left out in the wild on these topics.)

ASKER CERTIFIED SOLUTION
Avatar of Bodya
Bodya

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andrew_e

ASKER

Thanks for the info.

I'm using Outlook 97, so I think I'm going to use the "open"-event to activate the VB-created module that does the attachment manipulation.  I might consider writing a VC++ service program that periodically checks the inbox at a later stage.
If my memory serves me right (now I have Outlook 2000 and can't prove it :( ) in Outlook 97 there was no Application_NewMail event. Yes, the MailItem object had Open event but you won't be able to use it for notification of a new mail. I can imagine the only way - if you design an outlook custom form and there write using VB Script a handler to Open even, which is to call your application.
But if you want to process all mail (not only from those users in your corporation who use your custom form) you should use a periodicall scanning of Inbox or MAPI events.