I have some code that acts on the bodytext of a selected item in an Explorer window. It works really well when the selected item is a MailItem but is dying an ugly death on an email Bounce which I presume is not strictly a MailItem – but rather some sort of container of the real message.
How do I precheck what type of entity the item within the explorer selection really is?
The relevant code is
DIm myitem as MailItem
Set myItem = myExplorer.Selection.Item(1)
theirBody = myItem.Body
and it dies on this kind of message
Your message did not reach some or all of the intended recipients.
Subject: Blah Blah Rhubarb
Sent: 30/03/2007 4:03 a.m.
The following recipient(s) could not be reached:
a@b.c on 30/03/2007 4:03 a.m.
There was a SMTP communication problem with the recipient’s email server. Please contact your system administrator.
<mail.domainname.somewhere #5.5.0 smtp;550 Invalid recipient: >
Any light you could shed would be much appreciated. A secondary question is “what kind of message” is one of these, and how would we identify the original message that needed to be re-sent?