PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming NewMail event and Rules

Reply

NewMail event and Rules

 
Thread Tools Rate Thread
Old 04-11-2004, 02:40 PM   #1
R Avery
Guest
 
Posts: n/a
Default NewMail event and Rules


I have tested out which fires first, a rule or the NewMail event in OL
2002. The rule applies first. This makes it very difficult to figure
out which email was just received.

Normally, I'd get the default inbox folder and take the first item, but
if it has already moved to somewhere else because of a rule, then there
is nothing I can do (except find which email has the most recent
received date, but that would take prohibitively long).

Is there anyway around this? Is there anyway to get a reference to the
just-received email after a rule has been applied to it?
  Reply With Quote
Old 04-11-2004, 05:24 PM   #2
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
 
Posts: n/a
Default RE: NewMail event and Rules

Your best bet for processing an incoming e-mail is to work with the ItemAdd
event, although this won't fire if a large number of messages are
added/delivered at the same time. Otherwise, you can write an Exchange Event
Sink to intercept the messages before they are even delivered to your Inbox.

These articles have some great info:

OL2002: ItemAdd Event Doesn't Run in Some Scenarios:
http://support.microsoft.com/defaul...kb;en-us;290653

How to create a custom rule using Visual Basic for Applications (VBA) in
Outlook 2002:
http://support.microsoft.com/defaul...kb;en-us;292063

Exchange Store Event Sinks:
http://msdn.microsoft.com/library/e....asp?frame=true

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"R Avery" wrote:

> I have tested out which fires first, a rule or the NewMail event in OL
> 2002. The rule applies first. This makes it very difficult to figure
> out which email was just received.
>
> Normally, I'd get the default inbox folder and take the first item, but
> if it has already moved to somewhere else because of a rule, then there
> is nothing I can do (except find which email has the most recent
> received date, but that would take prohibitively long).
>
> Is there anyway around this? Is there anyway to get a reference to the
> just-received email after a rule has been applied to it?
>

  Reply With Quote
Old 04-11-2004, 09:50 PM   #3
R Avery
Guest
 
Posts: n/a
Default Re: NewMail event and Rules

Very sexy. Thanks, eric!


Eric Legault [MVP - Outlook] wrote:
> Your best bet for processing an incoming e-mail is to work with the ItemAdd
> event, although this won't fire if a large number of messages are
> added/delivered at the same time. Otherwise, you can write an Exchange Event
> Sink to intercept the messages before they are even delivered to your Inbox.
>
> These articles have some great info:
>
> OL2002: ItemAdd Event Doesn't Run in Some Scenarios:
> http://support.microsoft.com/defaul...kb;en-us;290653
>
> How to create a custom rule using Visual Basic for Applications (VBA) in
> Outlook 2002:
> http://support.microsoft.com/defaul...kb;en-us;292063
>
> Exchange Store Event Sinks:
> http://msdn.microsoft.com/library/e....asp?frame=true
>
> --
> Eric Legault - B.A, MCP, MCSD, Outlook MVP
> --------------------------------------------------
> {Private e-mails ignored}
> Job: http://www.imaginets.com
> Blog: http://blogs.officezealot.com/legault/
>
>
> "R Avery" wrote:
>
>
>>I have tested out which fires first, a rule or the NewMail event in OL
>>2002. The rule applies first. This makes it very difficult to figure
>>out which email was just received.
>>
>>Normally, I'd get the default inbox folder and take the first item, but
>>if it has already moved to somewhere else because of a rule, then there
>>is nothing I can do (except find which email has the most recent
>>received date, but that would take prohibitively long).
>>
>>Is there anyway around this? Is there anyway to get a reference to the
>>just-received email after a rule has been applied to it?
>>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off