Forum Discussion
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 to get it to work. Any help would be greatly appreciated. Thanks
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.
4 Replies
- JKPieterseSilver Contributor
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.
- shetzelBrass 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
- JKPieterseSilver ContributorIf you want multiple addresses, use this instead of "address1":
array("address1","address2","address3")