Jun 07 2021 04:11 PM - edited Jun 07 2021 04:14 PM
Is there a way to get the macro recorder to record "Send to Mail Recipient" function with "send the current sheet as message body" option? I'm really trying to get the VBA code that converts the sheet to HTML format when I click "Send to Mail Recipient".
I would like to automate sending an Excel table inside an Outlook email with matched formatting between the table in the email and the table in Excel. The "Send to Mail Recipient" function formats the email perfectly, but the macro recorder does not record this function when I try it. There are guides on sending emails in VBA code, but formatting the table seems like it would be very difficult to code especially since the table changes size. (I can't just use email source code for the HTML code).
Jun 07 2021 11:11 PM
I did some searching and this code actually worked really well. Link.
It seems to open Outlook and do a copy and paste including formatting. Table size is obtained to account for changes in size.
Thanks.
@worker565