Copy/Paste Range of cells into outlook email with pretyped body

trat1234

New Member
Joined
Aug 30, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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
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
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top