Forum Discussion
shetzel
Sep 12, 2024Brass Contributor
Add recipients and email workbook in a macro
I have a macro and it pulls up Outlook with the attached workbook and then I have to fill in the recipient, but would like the macro to do that for me. I have searched the code but have not been able...
- Sep 12, 2024
shetzel In your code there is this line:
Application.Dialogs(xlDialogSendMail).ShowWhat is not widely known is that the Show method accepts arguments. The first argument is the "To" email address. So if you change that code to this:
Application.Dialogs(xlDialogSendMail).Show "email address removed for privacy reasons"the To address wil be prefilled with "email address removed for privacy reasons. ". In addition, the second argument is the subject line.
shetzel
Sep 12, 2024Brass Contributor
I entred the line you provided and it works for the first email recipient, but how do I get it to go to multiple recipients?
Thanks
JKPieterse
Sep 13, 2024Silver Contributor
If you want multiple addresses, use this instead of "address1":
array("address1","address2","address3")
array("address1","address2","address3")
- shetzelSep 13, 2024Brass ContributorThank you