Hi I am copying data from Excel to an email
I want to copy data from a range as an image and pop it into the email. This is working ok.
I also want to add some headings after the image in the body of the email. This also works ok.
BUT when I want copy the image to the email then add body headings under the image I can not seem to have both, only one or the other.
I am using the following code.
If I comment the paste picture I get the body text im after. But I want the pictue then the body text underneath.
any help would be appreciated.
I want to copy data from a range as an image and pop it into the email. This is working ok.
I also want to add some headings after the image in the body of the email. This also works ok.
BUT when I want copy the image to the email then add body headings under the image I can not seem to have both, only one or the other.
I am using the following code.
Code:
Sub Rprt()
'Copy range of interest
Dim r As Range
Set r = Range("A2:J69")
r.Copy
'Open a new mail item
Dim outlookApp As Outlook.Application
Set outlookApp = CreateObject("Outlook.Application")
Dim OutMail As Outlook.MailItem
Set OutMail = outlookApp.CreateItem(olMailItem)
'Get its Word editor
OutMail.Display
Dim wordDoc As Word.Document
Set wordDoc = OutMail.GetInspector.WordEditor
'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Shut Execution Report"
.HTMLBody = "<hr><h3>Safety</ht> <h5>(Details Here)</ht><h3>FRW</ht><h5>(Details Here)</ht> <h3>Critical Path</ht><h5>(Details Here)</ht> <h3>Emergent Work</ht><h5>(Details Here)</ht> <h3>General</ht><h5>(Details Here)</ht>"
End With
End Sub
If I comment the paste picture I get the body text im after. But I want the pictue then the body text underneath.
any help would be appreciated.