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?