Operating system:: win 11
Outlook version: Microsoft 365 apps f
Email type or host: IMAP
Outlook version: Microsoft 365 apps f
Email type or host: IMAP
I have a VBA added to 2 Win 11 PCs. The VBA is identical on both PCs but yet it only works on 1 of the PCs. I get no error message but the VBA is supposed to send a BCC to an email address. The below is the VBA but I substituted a phony email address. As you can see, I got the VBA from this forum.
Sub Automatic_BCC_of_Sent_Email()
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 = "XXXX@OUTLOOK.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
' INSTALLATION INSTRUCTIONS Automatically BCC All Messages
' Open the VBA Editor using Alt+F11.
' Expand Project1 and double click on ThisOutlookSession.
' Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
' Don't forget to replace address@domain.com with the correct address.
Sub Automatic_BCC_of_Sent_Email()
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 = "XXXX@OUTLOOK.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
' INSTALLATION INSTRUCTIONS Automatically BCC All Messages
' Open the VBA Editor using Alt+F11.
' Expand Project1 and double click on ThisOutlookSession.
' Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
' Don't forget to replace address@domain.com with the correct address.