1

I want to copy a range of cells into an Outlook template that has a message in the body.

Sub SendEmail_Class_Name()

Dim r As Range
Set r = Range("A1:AA3")
r.Copy

Dim EmailApp As Outlook.Application
Dim Source As String
Set EmailApp = New Outlook.Application

Dim EmailItem As Outlook.MailItem
Set EmailItem = EmailApp.CreateItem(olMailItem)

EmailItem.To = "Name@gmail.com"
EmailItem.CC = "Name1@gmail.com; Name2@gmail.com;" & _
                "Name3@gmail.com; Name4@gmail.com"
EmailItem.Subject = "Test Email From Excel VBA"
EmailItem.HTMLBody = "Hey,<p>" & "Seeing if this Macro will send an Email<p>" & _
                    "Thanks,<p>"
Source = ThisWorkbook.FullName
EmailItem.Attachments.Add Source

EmailItem.Display
Dim wordDoc As Word.Document
Set wordDoc = EmailItem.GetInspector.WordEditor

wordDoc.Range.PasteAndFormat wdChartPicture

End Sub

The code pulls up the template with the To, CC, and Subject but the message in the body will not appear only the picture of the cells.
I tried putting the picture before the code for the message and only the message will appear and not the picture.

How do I order my code so that both the message and picture appear in the body of the email?

Community
  • 1
  • 1
Trat246
  • 7
  • 7
  • 1
    Check out my simple sample on Copy and pasting excel ranges into outlook [Copy xl to outlook](https://www.youtube.com/watch?v=hCBgPhnXnvk) – Davesexcel Aug 30 '22 at 16:30
  • 1
    Does this answer your question? [Pasting Excel Range as Image](https://stackoverflow.com/questions/49521170/pasting-excel-range-as-image) – niton Aug 30 '22 at 17:04
  • @Davesexcel I formatted your code to fit mine and it is working. Thank you – Trat246 Aug 30 '22 at 17:18

0 Answers0