I am currently using Outlook 2010 with Visual Basic 7.0 installed. I have multiple emails set up on my profile that I need to have access to for wrk. I am trying to set up each email so that it bcc's itself. For example:
When I send an email from email@example.com
, I want the auto bcc to go to firstname.lastname@example.org
. When I send an email from email@example.com
, I want an email to automatically be bcc'd to firstname.lastname@example.org
This is the basic code I am currently using. Regardless of the email account I send an email from, the bcc is always "email@example.com".
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 = "firstname.lastname@example.org"
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
Set objRecip = Nothing
Is there a way I can manipulate this code or do I need to set up a seperate profile for each of my individual emails?