Is there a function for testing the actual datatype of an object? I have an application that should run a certain procedure whenever an Outlook.MailItem is opened, by passing the Inspector.CurrentItem into the procedure as a parameter. However, if the user actually opened a read-receipt, this causes an error because the Inspector.CurrentItem is now an Outlook.ReportItem instead.

Is there a way of saying something like:
VB Code:
  1. If DataType(Inspector.CurrentItem) = Outlook.MailItem Then
TIA...