Test message if it is email

  • Thread starter Thread starter peter.sitskoorn
  • Start date Start date
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
 
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
 
Back
Top