Home>Blogs>VBA>VBA: Send Email With Outlook Mail body Snapshot

VBA: Send Email With Outlook Mail body Snapshot

In this article you will learn how to send an Outlook Email with mail body snapshot like Excel tables, Charts or images by using VBA. We will use “Mail Envelope” method to sending the email. This method is quite easy and small.

We have to create our data on a worksheet in email format and It will send the entire worksheet or selected range on outlook mail body.

As in the below given image range “A1:H31“will be send to on email. To,CC and Subject information have been given on column L.

Send Email With Outlook Mail body Snapshot
Send Email With Outlook Mail body Snapshot



How to create a macro to Send Email With Outlook Mail body Snapshot?

  • Copy the below given code
  • Open a new workbook or you can use your existing workbook also.
  • Go to Visual Basic Editor (Press Alt+F11)
  • Insert a new module (Press Alt+I+M)
  • Paste this code.
  • Save workbook as macro enabled.
  • Create the data in mail format.
  • Change the code according to your data range.
Sub Send_Email_With_snapshot()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sheet1")

Dim lr As Integer
lr = sh.Range("A" & Application.Rows.Count).End(xlUp).Row

sh.Range("A1:H" & lr).Select

With Selection.Parent.MailEnvelope.Item
.to = sh.Range("L6").Value
.cc = sh.Range("L7").Value
.Subject = sh.Range("L8").Value
.attachments.Add "C:\Users\User\Desktop\Projects\Mar-2018.xlsx"
End With

MsgBox "Done"

End Sub

After running this macro, Outlook may show popup as given in below image.

Outlook Popup
Outlook Popup

Click on Allow to send the email.


Click here to download this Excel File.

Watch the video tutorial to learn this macro:

Meet PK, the founder of PK-AnExcelExpert.com! With over 15 years of experience in Data Visualization, Excel Automation, and dashboard creation. PK is a Microsoft Certified Professional who has a passion for all things in Excel. PK loves to explore new and innovative ways to use Excel and is always eager to share his knowledge with others. With an eye for detail and a commitment to excellence, PK has become a go-to expert in the world of Excel. Whether you're looking to create stunning visualizations or streamline your workflow with automation, PK has the skills and expertise to help you succeed. Join the many satisfied clients who have benefited from PK's services and see how he can take your Excel skills to the next level!

Leave a Reply