VBA Outlook message formatting issue with Chart insertion

pingme89

Board Regular
Joined
Jan 23, 2014
Messages
176
Office Version
  1. 365
Platform
  1. Windows
I have VBA code that would open an new email and I want to add :

Hello,

<Email body text stored in as String Variable inserted here>

<Chart copied from Excel inserted here>

<Standard Signature inserted Here>


I have the following code. It all works except that the Chart is inserted after the Signature.
Does anyone know how to change it so the chart gets inserted between the Body text and and the Signature at the bottom?


With OutMail
.display
.to = Recipient
.CC = ""
.BCC = ""
.Subject = SubjectTitle

ThisWorkbook.Worksheets("Email Templates").Range(Rng).Copy
If Not TemplateType = 8 Then
Set vInspector = OutMail.GetInspector
Set wEditor = vInspector.WordEditor
End If
wEditor.Application.Selection.Start = Len(.Body)
wEditor.Application.Selection.End = wEditor.Application.Selection.Start
wEditor.Application.Selection.Paste

strSig = .HTMLBody
strBody = "<font face=Tahoma size=3> Hello, </calibri> <p>" & _
"<font color=black> " & MSGbody

'COMBINE THE EMAIL WITH THE SIGNATURE
.HTMLBody = strBody & strSig

'IF YOU DO NOT HAVE HTML IN THE BODY, USE THIS INSTEAD
'.Body = strBody & strSig




If attachmentloc <> "" Then
.Attachments.Add (attachmentloc)
End If




End With
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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