View Single Post
  #1  
Old November 21st 07, 01:21 PM posted to microsoft.public.outlook,microsoft.public.outlook.general,microsoft.public.outlook.program_vba
John
external usenet poster
 
Posts: 135
Default No image when stationery applied via code

Hi

I am applying stationary to my outgoing email message when sending mail via
code. The exact code is given at the end. The problem is that the image doe
snot appear in the stationery at the other end. What is the problem and how
can I get the image to accompany the mail as part of the stationary?

I am running the code from within MS Access.

Many Thanks

Regards


Code
====

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

With EM
.To = "
.Subject = "Any Subject"
.HTMLBody = HTMLTextAndSignature("This is body text")
.Display (False)
End With


Function HTMLTextAndSignature(EmailBody) As String
Dim fso
Dim Ts
Dim Signature As String

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

' [Body] is a tag in html file as a placeholder to actual body text ,
[Body] is replaced with actual body text here
If IsNull(EmailBody) Then
Signature = Replace(Signature, "[Body]", " ")
Else
Signature = Replace(Signature, "[Body]", EmailBody)
End If

HTMLTextAndSignature = Signature
End Function


Content of Email_Template.htm, the image that does not display is F:/Email
Stationery/investor+small.jpg
================================================== ====================

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
HTML
HEAD
META http-equiv=Content-Type content="text/html; charset=windows-1252"
style type="text/css"
!--
body {
background-attachment: fixed;
background-color: "#FFFFFF";
background-repeat: no-repeat;
font-family: "Century Gothic";
font-size: 10pt;
font-weight: normal;
}
--
/style
/HEAD
BODY BACKGROUND="file:///F|/Email Stationery/E.jpg" bgcolor="#FFFFFF"
table border=0 summary=""
tr
td width="464"
DIV align=left
My NameBR
/DIV
/td
td width="70" valign="bottom"br
img src="file:///F|/Email Stationery/investor+small.jpg" width="89"
height="59"
/td
/tr
/table
/body
/HTML


Ads