Hello, what I want to do is copy a range of cells and paste them into an outlook template that also has a message in the body. The code that I have is
As of now the code will run and pull up the template with the To, CC, and Subject correct but the message in the body will not appear only the picture of the cells and I tried putting the picture before the code for the message and only the message will appear and not the picture. So, my question is how do I order my code so that both the message and picture appear in the body of the email.
Thanks
VBA Code:
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
As of now the code will run and pull up the template with the To, CC, and Subject correct but the message in the body will not appear only the picture of the cells and I tried putting the picture before the code for the message and only the message will appear and not the picture. So, my question is how do I order my code so that both the message and picture appear in the body of the email.
Thanks