Version 4.0 of Redemption introduced a completely new library: RDO (Redemption Data Objects) that can function as a complete replacement of the CDO 1.21 library.

While Safe*Item Redemption objects are designed to be used with either Outlook Object Model or CDO 1.21 objects to work around the security prompts with minimum modifications to the existing code, RDO is designed to provide a complete functionality replacement for CDO 1.21, which, besides being blocked by the security patch, also hasn't been updated (functionality-wise) for almost 10 years.

RDO blends the low level access of CDO 1.21 with the functionality of the Outlook Object Model. It can be used from any code: COM add-ins, EXEs, scripts, Windows Services, etc. It can be used in any language that supports IDispatch-friendly objects (VB, VB Script, Java, .Net languages, C/C++, Delphi, etc).

 

Getting Started with RDO

 

Much like CDO 1.21, only one RDO object is creatable - Redemption.RDOSession. All other RDO objects are retrieved through the RDOSession object, either directly or indirectly. Once you create an instance of the Redemption.RDOSession object, you must log on or connect to a MAPI session to be able to access other RDO objects, such as RDOStore, RDOFolder, RDOMail, etc. To differentiate between various Redemption objects (such as Redemption.SafeMailItem), all RDO object names are prefixed with "RDO": e.g. RDOMail object exposes attachments through its Attachments collection, which in turn returns Redemption.RDOAttachments objects, etc.

If you already have experience with CDO 1.21 ("Professional CDO Programming" is highly recommended), you are ready for RDO. If you are an Outlook Object Model expert, RDOSession object corresponds fairly closely to the Namespace object in OOM.

There are several ways to log on to a MAPI session in RDO:

Once you are logged on to a MAPI session, you can start accessing various MAPI objects exposed by RDO. The example below logs to the default MAPI session and prints out the subject of all messages in the Inbox folder:

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
  Debug.Print(Msg.Subject)
next

 

Of course you can mix RDO with the Outlook Object Model or CDO 1.21. The example below reads the (blocked by Outlook) SenderName property from an Outook MailItem object using RDO

set Session = CreateObject("Redemption.RDOSession")

'make sure RDO uses the same MAPI session as Outlook. Outlook 2002 and up only!
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
Msg = Session.GetItemFromID(MailItem.EntryID)

MsgBox Msg.SenderName

 

The same functionality can of course be implement using the old SafeMailItem Redemption object:

set SafeItem = CreateObject("Redemption.SafeMailItem")

SafeItem.Item = MailItem

MsgBox SafeItem.SenderName

 

 

Major differences between RDO and CDO 1.21/OOM