VBOffice

Create a Redemption SafeMailItem

The SafeMailItem of the Redemption library allows you to access properties of an email that are blocked by Outlook's security.

Last modified: 2006/05/21 | Accessed: 61.856  | #30
◀ Previous sample Next sample ▶
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.

The Redemption library contains Safe*Item objects for every Outlook object that has at least one blocked property or procedure. The mechanismen of blocking some properties was introduced with Outlook 2000 SP2 (optional), or SP3 respectively.

The process, for instance, to create a Redemption.SafeMailItem for an Outlook.MailItem is always the same as is the process for cleaning up the Redemption objects. So why not write reusable functions for both?


tip  How to add macros to Outlook
Private Function CreateSafeItem(Item As Object) As Object
  Dim rdItem As Object

  'E.g.: Outlook's MailItem turns to Redemption's SafeMailItem
  olName = TypeName(Item)
  rdName = "Redemption.Safe" & olName

  Set rdItem = CreateObject(rdName)
  rdItem.Item = Item
  Set CreateSafeItem = rdItem
  Set rdItem = Nothing
End Function

Private Sub ReleaseSafeItem(Item As Object)
  On Error Resume Next
  Set Item.Item = Nothing
  Set Item = Nothing
End Sub
OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.
email  Send a message