I wrote and addin for outlook 2003 and whenever my program hits a returned email and I try to open it as a mailitem it crashes my program.
What are returned emails if not a mailitem I can't seem to find a way to open those emails and parse them.
I wrote and addin for outlook 2003 and whenever my program hits a returned email and I try to open it as a mailitem it crashes my program.
What are returned emails if not a mailitem I can't seem to find a way to open those emails and parse them.
VB and Outlook 2003 return items as mailitem
Cute_Celina
Indeed what you are getting is a ReportItem (http://msdn.microsoft.com/library/default.asp url=/library/en-us/vbaol11/html/olobjReportItem_HV05247366.asp)
I'm not sure whether this object is exposed in the Office 2003 PIA or whether you need to use it at all. If you don't need it or you don't care about the contents, you can easily skip over "unwanted" items by doing something like this:
If TypeOf Item Is MailItem Then
' Do your processing here
End If
I had a similar problem a couple of year ago because AppointmentItems were unexpectedly (to me) showing up in the Inbox, and I had incorrectly assumed that everything was a MailItem.
Hope this helps,
flash.tato
My addin works very well to parse all internal incoming emails, but some return emails are crashing it if I don't error trap and ignore those emails. I'm starting to think I need to use the MAPI-MIME API (vs2005) as (maybe) I'm getting a mime (oldstyle) email (object) returned back to the box.
LalitSRana
ahmed921983
Eswans2000
Abel:
Thanks! I think that's going to do it for me.
I was able to find http://msdn.microsoft.com/library/en-us/vbaol11/html/olobjItems_HV05247829.asp and that shows all the child objects, of which the appointment object that is mentioned is there too. This seems to list all the possible objects that can land in an inbox.
Maybe it's just me but the MSDN library could be better organized, it seems to me it can be very difficult to find out what one doesn't know with the way it is layed out.
James Rea
EvilPenguin