astropringles
astropringles

Reputation: 879

How to embed image placed inside the excel into the .htmlbody of vbascript

This is my code of the .htmlbody

    .htmlBody="<html><center><img src='https://website.com/images/logo-small.png'></center></html>"

However, it needs to be downloaded before you can see the logo. So I put the logo inside the excel file, how do I convert it into an shape object and concatenate it inside the .htmlbody

Upvotes: 1

Views: 1532

Answers (1)

Ralph
Ralph

Reputation: 9434

Use the attachment property of the email to attach the picture to the email.

Then reference the picture in your email with a preceding .\ like so:

 .htmlBody="<html><center><img src='.\logo-small.png'></center></html>"
 .Attachments.Add "C:\yourPath\logo-small.png"

Upvotes: 2

Related Questions