So the below code works great for attaching a chart image into my email.
However I'd prefer the image shows up in the body. Rather than as an attachment.
If my email allows HTML (or maybe it doesnt need to) is there a way to insert the image into my .BODY ?
I've tried .Body = Fname without any luck ...
Thanks!!!
However I'd prefer the image shows up in the body. Rather than as an attachment.
If my email allows HTML (or maybe it doesnt need to) is there a way to insert the image into my .BODY ?
I've tried .Body = Fname without any luck ...
Thanks!!!
Code:
Sub SaveSend_Embedded_Chart()
Dim OutApp As Object
Dim OutMail As Object
Dim Fname As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
'fill in the file path/name of the gif file
Fname = Environ$("temp") & "\Theatre_Charts.gif"
'if you hold down the CTRL key when you select the chart
'in 2000-2010 you see the name in the name box(formula bar)
ActiveWorkbook.Worksheets("Home").ChartObjects("Chart 299").Chart.Export _
Filename:=Fname, FilterName:="GIF"
On Error Resume Next
With OutMail
.To = "a@gmail.com"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Station Inventory Charts"
.Attachments.Add Fname
.Display 'or use .Display
End With
On Error GoTo 0
Kill Fname
Set OutMail = Nothing
Set OutApp = Nothing
End Sub