Have you ever wanted to automatically BCC all your outbound
mail to a specific email address? In my case, one of my colleague wanted to send a copy of ALL sent
mail from Outlook at work to Gmail You could try to do this
via Outlook's Rules and Alerts, but there's no option to BCC...only cc. Did not prefer that all work contacts not know the personal Gmail address, and it's not very professional. Also don't want to manually
enter the Gmail address in the BCC field of every outgoing message. Found a solution through Visual Basic Scripting.
First you have to check your Outlook allow to run Macros. If not, do the steps to run Macros.
Private Sub Application_ItemSend (ByVal Item As Object, Cancel As Boolean)First you have to check your Outlook allow to run Macros. If not, do the steps to run Macros.
- From the menu bar, select Tools->Trust Centre
- In the Trust Centre's left navigation menu, click on Macro Security
- Select either Warnings for all macros or No security checks for macros (the first option requires you to enable macros every time Outlook starts, the second option enables macros automatically).
- Open MS Outlook 2007
- Under the Tools menu, select Macro > Visual Basic Editor (or Alt+F11)
- In the left menu bar, expand Project1, Microsoft Outlook Session, and open ThisOutlookSession
- Enter copy & paste this code, making sure to substitute someone@domain.com with your real Gmail address and "Outlook EMail Account " with your Outlook Account Email Address
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
On Error Resume Next
If Item.SendUsingAccount ="Outlook EMail Account" Then
strBcc ="someone@example.com"
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 If
End Sub
No comments:
Post a Comment