RDOReportItem object

 

RDOReportItem represents a mail-delivery report in an Inbox (mail) folder. The RDOReportItem object is similar to a RDOMail object (from which it is derived), and it contains a report (usually the non-delivery report) or error message from the mail transport system.
 

RDOReportItem is derived from the RDOMail object and as such inherits all the properties, methods and events implemented by the RDOMail object.

 

Returned by:

Everywhere RDOMail object is normally returned (RDOSession.GetMessageFromID, RDOFolder.Items, etc), RDOTaskItem will be returned if the message class is "REPORT.IPM.*".

 

The example below restricts the Inbox contents table based on the message class to return only report items. It then loops through these items and displays the report text for each item.

'remove these lines if Redemption (SafeOutlook) type library
'has been added to the project references list

RES_CONTENT = 3
FL_PREFIX = 2
FL_IGNORECASE = &H10000

dim Columns(0)
dim Row
dim Filter 'As Redemption.TableFilter
dim Restr 'As Redemption.RestrictionContent
dim Table 'As Redemption.MAPITable
PR_ENTRYID = &H0FFF0102
PR_MESSAGE_CLASS = &H001A001E

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Inbox = Session.GetDefaultFolder(olFolderInbox)
set Table = Inbox.Items.MAPITable

set Utils = CreateObject("Redemption.MAPIUtils") 'will need this to convert array to hex

'set up the restriction
set Filter = Table.Filter
Filter.Clear
set Restr = Filter.SetKind(RES_CONTENT)
Restr.ulFuzzyLevel = FL_PREFIX or FL_IGNORECASE
Restr.ulPropTag = PR_MESSAGE_CLASS
Restr.lpProp = "REPORT.IPM"
Filter.Restrict


'restriction is done, read the data
Columns(0) = PR_ENTRYID
Table.Columns = Columns
Table.GoToFirst
do
  Row = Table.GetRow
  if Not IsEmpty(Row) Then
    strEntryID = Utils.HrArrayToString(Row(0))
    set Msg = Session.GetMessageFromID(strEntryID)
    MsgBox Msg.ReportText
  End If
Loop Until IsEmpty(Row)

 

Properties

Methods

 


Derived from: RDOMail

In addition to all the properties specific to RDONoteItem, it also implements all properties, methods and events of the RDOMail object, from which it is derived.


Properties


ReportText

Returns a string representing the report text as displayed by Outlook. Note that there is no single MAPI property corresponding to ReportText; it is dynamically generated based on various MAPI properties from the message and its recipients table.

 

Methods


FindOriginalItem

Returns the original item from the Sent Items folder that generated the report.

FindOriginalItem will retrieve the value of the PR_ORIGINAL_SEARCH_KEY MAPI property from the report and attempt to find the item with the same value of the PR_SEARCH_KEY property in the Sent Items folders.

If PR_ORIGINAL_SEARCH_KEY is not available or if the item cannot be found, an error will be returned.

on error resume next
err.clear
set Msg = Report.FindOriginalItem
if Err.Number = 0 Then
  MsgBox Msg.Body
Else
  MsgBox "Could not find the original message: " & Err.Description
End If