Redemption library consists of two families of objects: Safe*Item family of objects (listed on this page), which are designed to be used alongside your existing Outlook Object Model or CDO 1.21 code, and RDO (Redemption Data Objects), which are designed to be used as a CDO 1.21 or Outlook Object Model replacement. Unlike the Outlook Object Model objects, RDO objects can be used in a service or in a multithreaded environment.

 

 

Using Safe* Redemption Objects

Redemption is a regular COM object; once registered on the system, it is accessible to any programming language (VB, VBA, VB.Net, C#, VC++, Delphi, etc). Redemption uses Extended MAPI (which is not affected by the Security Patch since it is not accessible to the scripting languages) to duplicate the functionality blocked by the Security Patch.

 

Most creatable Redemption objects have an Item property which must be set to an Outlook item. Once set, you can access any properties and methods available on an original Outlook item, both blocked and not blocked.

For the blocked properties and functions Redemption objects completely bypass Outlook object model and behave exactly like Outlook objects with no Security Patch applied.

For the properties not blocked by the Security Patch, all calls to the properties and methods are forwarded to the Outlook object you assign to the Item property. With this approach changes to your code are minimal: you only change the way you declare the objects, but not the rest of your code that actually accesses blocked and not blocked properties and methods.

 

dim SafeContact, oContact
set SafeContact = CreateObject("Redemption.SafeContactItem")
'Create an instance of Redemption.SafeContactItem
set oContact = Application.Session.GetDefaultFolder(10).Items(1)
'Get a contact item from Outlook
SafeContact.Item = oContact
'set Item property of a SafeContact to an Outlook contact item
MsgBox SafeContact.Email1Address
'access Email1Address property from SafeContact, no warnings are displayed

 

 

There are matching objects for all other Outlook items with blocked properties: SafeContactItem, SafeMailItem, SafeTaskItem, SafeJournalItem, SafeMeetingItem and SafePostItem. See the list on the left for a complete list of objects, properties and methods handled directly by Redemption.

Below are examples of code snippets before and after the change. Code in red corresponds to the difference in code between the two versions:

  

VB Script:

dim Contact
set Contact = Application.Session.GetDefaultFolder(10).Items(1)


MsgBox Contact.Email1Address '
With Security patch, a warning is shown
no code below is affected


dim Contact, oContact
set oContact = Application.Session.GetDefaultFolder(10).Items(1)
set Contact = CreateObject("Redemption.SafeContactItem")

Contact.Item = oContact 'never use "Set" when setting the Item property
MsgBox Contact.Email1Address 'No warnings are shown
no code below is affected:
'You can access Contact object as if no Security patch is applied

  

VB:

dim Contact as Outlook.ContactItem
set Contact = Application.Session.GetDefaultFolder(10).Items(1)


MsgBox Contact.Email1Address
no code below is not affected


dim Contact as Object, oContact as Object
set oContact = Application.Session.GetDefaultFolder(10).Items(1)
set Contact = new Redemption.SafeContactItem

Contact.Item = oContact 'never use "Set" when setting the Item property
MsgBox Contact.Email1Address
no code below is not affected

  

C#:

Outlook.ContactItem Contact;
set Contact = Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts).Items.GetFirst();
MsgBox.Show(Contact.Email1Address);
no code below is not affected


Outlook.ContactItem Contact;
set Contact = Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts).Items.GetFirst();
Redemption.SafeContactItem sContact = new Redemption.SafeContactItem();
sContact.Item = Contact;

MsgBox.Show(
sContact.Email1Address);
no code below is not affected


Declare Contact as Object rather than Outlook.ContactItem if you are using VB: even though all Safe*Item objects expose all properties and methods of the corresponding Outlook items, they do so dynamically when you assign an Outlook item to their Item property - at design time compiler will complain that most properties and methods are not found if you declare them as anything but Object.