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.
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 = “[email protected]”
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 https://www.slipstick.com/outlook/email/automatically-bcc-all-message/
‘ 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 [email protected] with the correct address.
I tried changing the email address that it sends to but did nt help. As I said, the exact same VBA with the same email address works on a notebook Win 11 PC. The vba is signed so that is not the issue and my macro setting says its okay for signed macros
Neil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.