Thursday 19 March 2009

automatically BCC in Outlook 2007

Have you ever wanted to automatically bcc all your outbound mail to a specific email address? I wanted to send a copy of ALL sent mail from Outlook at work to my Gmail address. You could try to do this via Outlook's Rules and Alerts, but there's no option to bcc...only cc. I'd prefer that all my work contacts not know my personal Gmail address, and it's not very professional. I also don't want to manually enter my Gmail address in the bcc field of every outgoing message... the solution? Visual Basic Scripting.

The steps (MS Outlook 2007):

  1. Open MS Outlook 2007
  2. Under the Tools menu, select Macro > Visual Basic Editor (or Alt+F11)
  3. In the left menu bar, expand Project1, Microsoft Outlook Session, and open ThisOutlookSession
  4. Enter copy & paste this code, making sure to substitute youremailaddress@domain.com with your real email address:
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 = "youremailaddress@domain.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 Sub

Save the session, close the Visual Basic Editor, restart Outlook, and you're good to go! (make sure that you've allowed Outlook to run macros) You can verify that your emails are being cc'd by (1) checking your alternate email address or (2) looking at the bcc field of one of your messages in the Sent Items folder.

29 comments:

Joey said...

this iss super i had same problem with rules and alerts

Mina said...

Hi,

This is very great!

How can we adjust it to BCC only if the "subject includes a spcific string?

Many thanks,
Mina

Anonymous said...

how do i see the BCC field in my sent emails?

Anonymous said...

have followed above rules and copied code but doesn't seem to work. what is bit is green re ' #### USER OPTIONS ####' address for Bcc -- must be SMTP address or resolvable' to a name in the address book - Thanks

andrew said...

@Anonymous(1)- Open your Sent Items folder and then open a message which was bcc'd. In the header/info portion of the email (top left) you will see the bcc address under the "Bcc:" field. This should appear below the "To:" field and immediately above the Subject.

andrew said...

@Anonymous(2) - The green portion of the code is a comment. It doesn't affect the rest of the code, but it reminds users that the email address you enter (to replace the red text) must either be a normal SMTP resolvable email address or a name in your Address Book.

Anonymous said...

Dear Andrew,
It's a great script and work well.
However, I wonder if we would like to multiple
BCC: email address.
What can I do or edit the code ?

Thank a million..

Nont

EricaB said...

This is awesome. One question: Can you tie it to a specific account? I have several accounts set up in my outlook, and I only want the auto bcc for two of them. Any help would be greatly appreciated!

andrew said...

@EricaB hmm not sure how to tie it to a single account. I've just played with global Outlook rules. You could try adding 'If Item.SenderEmailAddress = "YOUR@EMAIL.COM"' below line 'objRecip.Type = olBCC' and another 'End If' below the current two. May/may not work...

Anonymous said...

I've used this to Bcc our new CRM system and it works perfectly. Thanks you've just saved me a $100

Anonymous said...

If you want to send to two forwarding addresses, can this be done?

andrew said...

@Anon - Hmm, I'm not sure. Try substituting "youremailaddress@domain.com" with "address1@domain.com;address2@domain.com" Unfortunately I no longer use Outlook and cannot test this out.

Anonymous said...

Andrew,

Thank you, thank you, thank you for this wonderful macro!

olearydc said...

Great..Thanks

For the last few years have been doing this manually and was a pain.

never made a macro. so this was perfect and it works!

Cheers

ertpresso said...

It does not work with my Outlook 2007 SP2. :(

andrew said...

@ertpresso - Why not/what happens?

Anonymous said...

Doesn't work on my Outlook 2007 either. The mail sends but when I check the Sent Items there is no Bcc in the mail item and it does not come through to the email address I specified, (which is in my address book). If it matters I run a 32 bit version of Win 7.

Rupesh said...

I want Hide BCC name when i open sent item mail its showing me. I have to take it confidentially. please help me,
Thank in Advance

RBL said...
This comment has been removed by the author.
RBL said...

Hi,

I've noticed this script does not work when I am replying to or forwarding a message that has been filed to a folder.

Thought you would want to know. I'm going to try to figure it out.

Thanks.

Rich

Maaar ツ said...

Thank you very much for sharing this, it helps me a lot !!!

Anonymous said...

Thanks! This is just what I needed.

Unknown said...

Amazing thanks!!!

Anonymous said...

Thank you!! It is very helpful..

Anonymous said...

thanks

it is working :)

T said...

I signed in just to say thank you for this script.
Thank you very much :)

Anonymous said...

Hello Andrew,

It's very helpful.

Thank you very much!

Julius

Anonymous said...

It's working properlly.

Thank you very much!

Arbak Apuhc said...

This has worked for decades... since two weeks ago it's stopped working. I'm not sure why... anyone else with the same issue?

Thanks

  © Blogger template 'Isolation' by Ourblogtemplates.com 2008

Back to TOP