Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
Sub PrintWithBCC()
Dim objItem As Object
Dim objProp As Outlook.UserProperty
On Error Resume Next
' uses the GetCurrentItem function
Set objItem = GetCurrentItem()
If objItem.MessageClass = "IPM.Note" Then
Set objProp = objItem.UserProperties("Bcc")
If objProp Is Nothing Then
Set objProp = objItem.UserProperties.Add("Bcc", olText, True)
End If
' next statement will trigger security prompt in Outlook 2000 & 2002
' consider using Redemption from http://www.dimastr.com/redemption/
objProp.Value = objItem.BCC
objItem.PrintOut
objProp.Delete
objItem.Save
End If
End Sub
Thanks to Sue Mosher....
www.outlookcode.com