View Single Post
  #8  
Old June 8th 06, 03:24 AM posted to microsoft.public.outlook.program_addins
Damian
external usenet poster
 
Posts: 6
Default Useing Redemption Object to Read an Inbox

Hi Dmitry and Ken,

Thanks for your help. What I still dont understand is what do I link
the Redemption SafeReportItem to ?

This is what I thought needed to be done

Dim Session As MAPI.Session
Dim Application, Namespace1
Dim Session2, BodyStr
Dim Inbox, Msg

Session = CreateObject("MAPI.Session")
Session.Logon(ProfileName:="profile_name",
ProfilePassword:="password")
Application = CreateObject("Outlook.Application")
Namespace1 = Application.GetNamespace("MAPI")
Namespace1.Logon()
Session2 = CreateObject("Redemption.RDOSession")
Session2.MAPIOBJECT = Application.Session.MAPIOBJECT
sRItem = CreateObject("Redemption.SafeReportItem")
Inbox = Session2.GetDefaultFolder(6)
For Each Msg In Inbox
sRItem.Item = Msg
BodyStr = sRItem.Body
Next

If anyone can point out where I am wrong it would be appreciated

Regards
Damian




Dmitry Streblechenko wrote:
Also note that NDRs in most cases do not have a message body in tehe regular
sense (PR_BODY etc). What Outlook displays is created dynamically from
various properties in the recipient table - look at an NDR with OutlookSpy
(click IMessage, GetRecipientTable taab is what you need).
If you need to read the ND properties, use Recipient.Fields(); if you just
need all the data in a single blob a-la Outlook, use SafeReportItem in
Redemption and read the Body property.

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

"Ken Slovak - [MVP - Outlook]" wrote in message
...
NDR's are non-delivery reports. As Dmitry said and I indicated those items
are not MailItems, they are ReportItems and that's why your code is
failing. Use RDOMail instead of SafeMailItem, which is only for MailItem
or use the Redemption.MessageItem object.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Damian" wrote in message
oups.com...
Hi Dmitry,

Thanks for your reply. What are NDR's?
I need to be able to read the body an email bounceback. I am able to
read the body of a standard email, but I cant read the body of an email
bounce back. It returns empty.

Regards
Damian



Ads