Test message if it is email

P

peter.sitskoorn

Hi all,
I made a code that adds a read receipt when my email message is send to
one of my senior managers. This code works fine, until I try to send a
meeting request. Is it possible to test if the message I send is an
email message?

The (basic)code currently run:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)

If Item.To Like "Manager1*" _
Or Item.To Like "Manager2*" Or Item.To Like "person1*" _
Or Item.To Like "person2*" Then
Item.ReadReceiptRequested = True
Else
End If

Thank you
Peter
 
S

Sue Mosher [MVP-Outlook]

You can use the Class property:

If Item.Class = olMail Then
' it is a mail message
End If

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top