ReportItem Body

J

Joe Maki

What I'm trying to do is loop through an inbox and retreive
information from emails that have failed to be delivered. I can get
the body of a MailItem and pull out the email address. My problem is
most of the notices appear to be ReportItems (Object.Class = 46).
When I try to retreive the body of the reportitem my string variable
seems to be blank. Am I missing something basic?

Dim iMail As Object
DIm fldInbox as Outlook.MAPIFolder

Set fldInbox =
Outlook.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)

For Each iMail In fldInbox.Items
If iMail.Class = olMail Or iMail.Class = olReport Then
With iMail
'read info from each piece of mail
strBody = .Body
If EmailPulled(strBody) Then
.FlagStatus = olFlagComplete
End If
End With
iChecked = iChecked + 1
End If
Next

Thanks, ...joe
 
D

Dmitry Streblechenko

Report items do not have a body like other messages, what Outlook displays
is constructed dynamically from various properties in the message recipients
table. You can access those properties using Extended MAPI or Redemption,
but not Outlook Object Model or CDO 1.21.
Look at a report message with OutlookSpy (click IMessage, then go to the
GetRecipientTable tab) to see what I mean.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top