Image not displaying when applying stationery via code

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am assigning stationery via code to a new email as below. The problem is
that the image included in stationery does not appear in the sent mail. What
is the problem and how can I fix it? There must be someone who has done this
sort of thing, and outlook being around for so long someone must have
figured a way to do this.

Thanks

Regards


Code
====

Set fso = CreateObject("Scripting.FileSystemObject")
Set Ts = fso.OpenTextFile("F:\Email Stationery\Email_Template.htm", 1)

Set OutlookApp = New Outlook.Application
Set EM = OutlookApp.CreateItem(olMailItem)

With EM
.To = "(e-mail address removed)"
.Subject = "Any Subject"
.HTMLBody = Ts.ReadAll
.Send
End With


Content of F:\Email Stationery\Email_Template.htm
==================================

<HTML>
<HEAD>
</HEAD>
<BODY>
<img src="file:///F|/MyFolder/MyImage.jpg" width="89" height="59">
</body>
</HTML>
 
John,

Looking at your code the issue would be:

<img src="file:///F|/MyFolder/MyImage.jpg" width="89" height="59">


The user does not necessarily have an F drive or the image stored in that folder. In order for it to work the image would have to be somewhere anyone could get to it.

Steve
 
Back
Top