Solved

New Mail Notication (how to detect)

Posted on 2000-02-25
4
244 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:andrew_e
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 2562992
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.)

0
 
LVL 2

Accepted Solution

by:
Bodya earned 50 total points
ID: 2564042
If you have Outlook 2000, with it's VBA model , as Neo_mvps note, you should add a reference to Ms Outlook Object Library to your VB project, and declare in a class module an Outlook.Application object "With Events".
To start programming Outlook look at
http://www.vb-world.net/articles/outlook/
 http://www.microsoft.com/OutlookDev/Articles/outprog.htm

If you have an older version I recommend you to write a stand-alone application which checks the contents of Inbox periodically. The way Neo_mvps proposed, seems to be very complicated.
0
 

Author Comment

by:andrew_e
ID: 2564302
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.
0
 
LVL 2

Expert Comment

by:Bodya
ID: 2564335
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now