I've set up a macro to send an e-mail through Outlook.
.Body is read from a cell inside the file with indents. Since the value will change depending on the usage, I need to reference that cell for the body.
However, there rises 2 issues using .HTMLbody I lose indents which are constructed with CHAR(10) but I keep the default HTML signature.
When using just .BODY indents are displayed are correctly however the default signature is not constructed as HTML and I lose the images.
How should I go about fixing this issue?
My code:
sig = .HTMLBody
body = xlSht.Range("B4").Value
.To = xlSht.Range("B2").Value
.CC = ""
.Subject = xlSht.Range("B1").Value
.body = body & sig
.Display
I'd really appreciate your assistance.
Thanks.
body = Replace(body, vbLf, "<br>")
and then use HTMLBodyBodyFormat
of MailItem varirable to olFormatHTML ,kindly adapt to you codeDim objNewEmail As Outlook.MailItem objNewEmail.BodyFormat = olFormatHTML