PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Re: Application_NewMail() HELP

Reply

Re: Application_NewMail() HELP

 
Thread Tools Rate Thread
Old 18-09-2003, 05:50 PM   #1
Randy Byrne [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Application_NewMail() HELP


Evaluate the .MessageClass or the .Class property of the object to determine
if you have a message or meeting request, etc. The message class for a
MailItem is IPM.Note.

--
Randy Byrne, MVP - Outlook
http://www.microeye.com
Building Applications with Microsoft Outlook 2002 (MSPress - July 2001)
Building Applications with Microsoft Outlook 2000 (MSPress)
http://www.microeye.com/books
Micro Eye ZipOut
http://www.microeye.com/zipout



"Jeff" <jeffpa@stargate.net> wrote in message
news:007901c37df1$84fcb490$a101280a@phx.gbl...
> I am using the Application_NewMail() to sort through
> emails. How do I differentiate between an Email and an
> Appointment?
>
> In the following code, when I attempt to set
> olmail=objInbox.Items(x), when objInbox.Items(x) is an
> appointment, my code bombs. How do I determine whether
> objInbox.Items(x) is mail or something else? Thanks.
>
> For x = 1 To objInbox.Items.Count
> Set olmail = objInbox.Items(x) <THIS IS WHERE IT BOMBS
> If olmail.UnRead = True And olmail.Subject = "subj" Then
> <run a sub>
> olmail.UnRead = False
> Exit For
> End If
> Next x



  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