Hello all,
I have a macro that sends automated emails. I am not going to post the entire code because it is quite long... doing things like running of an excel sheet, dynamically updating the email text and a form word document, saving, printing, etc... but this macro worked for months. A few weeks ago, we upgraded from Windows XP to Windows 7. We are using Outlook 2010.
The previous code correctly updates and the email and attaches appropriate documents as well as gets the appropriate subject.
The problem I am having is a Runtime Error 5 (invalid procedure call), on the .Send line, but I only get it when sending emails outside of the organization.
So for example, if the first email is to my work address, and my second email is to my personal email... It sends fine on the first email, but I get this error when sending to my personal email.
In troubleshooting, "Email" is correctly set to the email address, but when you open the unsent message, the "To" Line is blank.
Thank you for any help you can provide.
I have a macro that sends automated emails. I am not going to post the entire code because it is quite long... doing things like running of an excel sheet, dynamically updating the email text and a form word document, saving, printing, etc... but this macro worked for months. A few weeks ago, we upgraded from Windows XP to Windows 7. We are using Outlook 2010.
Code:
Set MailSendItem.SaveSentMessageFolder = olFolder
With MailSendItem
.Subject = SubjectDyn
.HTMLBody = MsgBodyDyn
.To = Email
.DeleteAfterSubmit = False
.Display
.Send
End With
The previous code correctly updates and the email and attaches appropriate documents as well as gets the appropriate subject.
The problem I am having is a Runtime Error 5 (invalid procedure call), on the .Send line, but I only get it when sending emails outside of the organization.
So for example, if the first email is to my work address, and my second email is to my personal email... It sends fine on the first email, but I get this error when sending to my personal email.
In troubleshooting, "Email" is correctly set to the email address, but when you open the unsent message, the "To" Line is blank.
Thank you for any help you can provide.