Solved

New Mail Notication (how to detect)

Posted on 2000-02-25
4
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Mailbox Overload?
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

632 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