Macro to Send Excel Table Inside an Email

Copper Contributor

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).

1 Reply

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