Well, for one thing I wouldn't use NewMail(). It doesn't tell you what was
received and it misses things. I'd use NewMailEx() instead, which supplies a
list of items received as a list of EntryID's.
Always use F2 to open the Object Browser and that lets you see all methods,
properties and events for all Outlook items. Then use the Help to see code
samples. In the case of Application.NewMailEx() the code sample shows how to
get an item from the collection of EntryID's. That item (mai) can be used
thusly to check the MessageClass:
If ((Left(mai.MessageClass, Len("REPORT.IPM.Note")) = _
"REPORT.IPM.Note") And (Right(mail.MessageClass, _
Len("IPNRN")) = "IPNRN")) Then
' this is a read receipt, do whatever
End If
You should also become familiar with the
www.outlookcode.com Web site, that
has code samples for almost anything Outlook related.