Solved

New Mail Notication (how to detect)

Posted on 2000-02-25
4
229 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now