I thought i'd share my solution to anyone else who has had this issue. Below is a code I have written (or rather, hacked together!) which can import data from an outlook folder which contains a mixture of MailItems and ReportItems.
This code may be useful to you (after modification) if you need to run a report on how many emails have been sent out for example in a company awareness breifing and need to analyse the data of a folder which contains a mixutre of the emails responded to (Email Replies), emails read (read receipts) and emails not read (Not Read Reciept)
The easy bit with this code is importing data from the Emails (Mailitem), particularly the sendername from the Outlook Exchange Server as this Object has the .sendername Property. The tricky bit was trying to get the same information for a read receipt or any other type of Report Item as they do not have the same .sendername property! The solution was found through using the CDO library and creating a MAPI session in order to draw out the desired property of the Report Item.
The CDO method of extracting MAPI properties of a reportitem within this code was modified from using code found on the website http://www.cdolive.com/cdo5.htm ("Get the sender information of an Outlook item") so credit for the initial code should go to CDOLive.
The code below requires the following additonal References to be activated:
- Microsoft Office Outlook View Control
- Microsoft Forms 2.0 Object Library
- Microsoft CDO 1.21 Library
I hope this helps anyone who has had the same frustrations with this as I have or conversely, if anyone maybe has a more efficient/elegant version of this code which performs the same task then I would be interested to see.