I have the following basic email code in an Excel VBA:
Dim OutAppUser As Object
Dim OutMailUser As Object
Set OutAppUser = CreateObject("Outlook.Application")
Set OutMailUser = OutAppUser.CreateItem(0)
With OutMailUser
.To = Range("Ctl_Req_Email").Value
.CC = ""
.BCC = ""
.Subject = TempFNUser
.ReadReceiptRequested = False
.Body = userEmailText
.Attachments.Add FullTempNameUser
.Send 'Use .Send or .Display
End With
The workbook with this macro is widely distributed but actual driving of the email macro is done by only a few and now the email address where this goes has changed. I have created an Outlook rule for "after I send the message" which add's a "CC" for the new email address as a means of redirecting the email externally. The rule works perfectly on manual test emails, but does not seem to act on the email sent from the Excel VBA code. Does something additional needs to be coded on the VBA code to send the email in order to allow rules to run?
http://www.slipstick.com/outlook/email/choosing-the-folder-to-save-a-sent-message-in/
"VBA does not work on messages created with File, Send commands in other applications or the Send to command in Windows Explorer. Send to commands use Simple MAPI, which bypasses Outlook functionality."
Does not actually say Rules but you have seen Rules bypassed.
If you really want to use Rules, have Outlook open up Excel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With