Hello,
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
abc@joe.ca, I want the auto bcc to go to
abc@joe.ca. When I send an email from
xyz@joe.ca, I want an email to automatically be bcc'd to
xyz@joe.ca.
This is the basic code I am currently using. Regardless of the email account I send an email from, the bcc is always "abc@joe.ca".
Code:
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 = "josh@spurrell.ca"
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
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?
Help? :-)