Home > Uncategorized > Automatické odesílání bcc kopie u veškeré odchozí pošty z Outlooku 2007

Automatické odesílání bcc kopie u veškeré odchozí pošty z Outlooku 2007

February 17th, 2009 admin Leave a comment Go to comments

I have found several commercial plugins for Outlook 2007 allowing sending bcc copy to all outgoing emails. Who would like to spend $30 for this stuff … in case when in Thunderbird it was pretty common feature.

After couple minutes, I have found free solution using VBA script.

Just put this code into VBAProject.OTM:

Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)
    Dim objRecip As Recipient
    Dim strMsg As String
    Dim res As Integer
    Dim strBcc As String
    On Error Resume Next
 
    ' #### USER OPTIONS ####
    ' address for Bcc -- must be SMTP address or resolvable
    ' to a name in the address book
    strBcc = "someone@somewhere.dom"
 
    Set objRecip = Item.Recipients.Add(strBcc)
    objRecip.Type = olBCC
    If Not objRecip.Resolve Then
        strMsg = "Could not resolve the Bcc recipient. " & _
                 "Do you want still to send the message?"
        res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
                "Could Not Resolve Bcc Recipient")
        If res = vbNo Then
            Cancel = True
        End If
    End If
 
    Set objRecip = Nothing
End Sub

Editor can be opened using Alt+F11 in Outlook 2007, exploring Project tree on the right side and adding Application - ItemSend handler using top comboboxes.

Also it’s neccessary to change security settings:

  1. In Outlook 2000 to 2003, choose Tools | Macro | Security and set security to Medium. In Outlook 2007, the macro security settings are in the Tools | Trust Center dialog. Set macro security to Warn on all macros.
  2. Restart Outlook

URLs:

Bookmark and Share
Tags:
  1. No comments yet.
  1. No trackbacks yet.
Security Code: