How to: AutoBCC in Outlook 2016 / Office 365

 

This is continuation of the my earlier post on how to add AutoBCC in 2007 & 2010 outlook versions.

In this post I am adding the ways to how to add AutoBCC to Outlook 2016 / Office 365 Outlook. The area covered are:

 

  • How to enable / view VB Editor
  • How to Create Digital Certificate in this version of Outlook
  • How to add AutoBCC for all emails
  • How to add different BCC to email adresss for different accounts, if you use multiple accounts to send emails

 

  1. Enable / View VB Editor:

 

Office 365 /  Outlook 2016 installs initially with Developer options in hidden more.

Opening the Developer Tab

 

All Office 2016 applications use the ribbon. One tab on the ribbon is the Developer tab, where you access the Visual Basic Editor and other developer tools. Because Office 2016 does not display the Developer tab by default, you must enable it by using the following procedure:

 

To enable the Developer tab and view Visual Basic Editor, do the following steps:

 

A.

On the File tab, choose Options to open the Outlook Options dialog box.

B.

Click Customize Ribbon on the left side of the dialog box.

C.

Under Choose commands from on the left side of the dialog box, select Popular Commands.

D,

Under Customize the ribbon on the right side of the dialog box, select Main tabs, and then select the Developer check box.

E.

Click OK.

 

Please note: In Office 2007, you displayed the Developer tab by clicking the Office button, clicking Options, and then selecting the Show Developer tab in Ribbon checkbox in the Popular category of the Options dialog box

After you enable the Developer tab, Bingo, it is easy to find the Visual Basic and Macros buttons.

Developer tab in Outlook 2016

Source: https://blogs.msdn.microsoft.com/

 

  1. How to Create Digital Certificate

 

The “Digital Certificate for VBA Projects” is no longer a registered application that can be found from the start menu, but the executable is available in the following folder.

 

“C:\Program Files\Microsoft Office 15\root\office15\SELFCERT.EXE”

Or

“C:\Program Files (x86)\Microsoft Office\root\Office16\SELFCERT.EXE”

Or

if you can’t find it, search for SELFCERT.EXE In you C:\ drive.

 

Open that application and create a new (Any name) certificate. Close that application

 

  1. How to add AutoBCC for all emails

 

The further steps are as mentioned in my earlier post for AutoBCC 2007 & 2010 outlook versions.

Open VB Editor by going to Developer Tab, Editing :

– Project1 (VbaProject.OTM)

– Microsoft Outlook Objects

– ThisOutlookSession

Selecting “Application” in the editing Tab

 

Remember to select the digital certificate you have created by going to Tools – Digital Certificates in the VB Editor Menu

 

  1. How to add different BCC to email adresss for different accounts,

 

if you use multiple accounts to send emails, it will be convenient to have different email addresses as BCC address for different accounts that you chose while sending email.

Use the same steps of Opening VB Editor and Editing

For this you need to use If — Then loops to define each addresses.

 

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

strBcc1 = “BCC_To_email_1@domain1.com”
strBcc2 = “BCC_To_email_2@domain2.com”

‘ Use the account name as it appears in Account Settings
If Item.SendUsingAccount = “from_email1@domainA.com” Then

Set objRecip = Item.Recipients.Add(strBcc1)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = “Could not resolve the Bcc recipient. ” & _
“Do you want to send the message?”
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
“Could Not Resolve Bcc”)
If res = vbNo Then
Cancel = True
End If
End If

End If

If Item.SendUsingAccount = “from_email2@domainB.com” Then

Set objRecip = Item.Recipients.Add(strBcc2)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = “Could not resolve the Bcc recipient. ” & _
“Do you want to send the message?”
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
“Could Not Resolve Bcc”)
If res = vbNo Then
Cancel = True
End If
End If

End If

Set objRecip = Nothing
End Sub