I am stuck on this snippet to create the Excel chart and paste it into an email body as as HTML instead of as a jpg as many people receive the email can not view the jpg.
I tried to change this to
but it doesn't work.
What am I missing?
I tried to change this to
VBA Code:
[B].htmlbody = body & _HTML[/B]
What am I missing?
VBA Code:
'----Build Chart---------------------
Worksheets("File1").Range("A4").Value = SAMPLE
Call createChart("File1", "B3:N23", File2)
tempFilename2 = TempFilePath & File2 & ".jpg"
'------------------------------------
'----FILE NAME CHECKS----------------
'MsgBox tempFilename1
'MsgBox tempFilename2
'MsgBox File2 & ".jpg"
'------------------------------------
'----EMAIL FILE TO SAMPLE------------
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
On Error Resume Next
With OutMail
.display
.To = toemail
.CC = ccemail
.subject = subject
.Attachments.Add tempFilename1
.Attachments.Add tempFilename2, 1, 1
[B].htmlbody = body & _
"<br><br><img src=""cid:" & File2 & ".jpg"" height=450 width=650>" & .htmlbody[/B]
.display
'.Send
End With
On Error GoTo 0
Set OutApp = Nothing
Set OutMail = Nothing
toemail = ""
ccemail = ""
subject = ""
body = ""
'------------------------------------
'----DELETE THE FILE-----------------
Kill tempFilename1
Kill tempFilename2