PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Re: Application_NewMail() HELP
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Re: Application_NewMail() HELP
![]() |
Re: Application_NewMail() HELP |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

