Email - Signature with no Picture

J

JohnUK

Hi Can anyone help with this.
I have managed to programmatically attach a file to email with Signature
(Compliments to Ron de Bruin) but the problem I now have is, it wont attach
the Picture along with the Signature, just the outline. Also, is there a way
of changing the text in the email from the System default to something else?
Running Window 7 and Microsoft Outlook
Help greatly appreciated
Regards
John
 
R

Ron de Bruin

Hi John

Never try it with a picture
But it is possible to add htm that load a picture into the mail

You can change the text also with html
The best thing that you can do is to create a block of html with your Signature
and add it to the htmlbody
 
J

JohnUK

Hi Ron, Thanks for your reply.
The original has a picture within the Signature (html) but for some reason
it doesn’t want to show (Apart from the outline where it should be)
With regards the Text (Font) do you mean add a block so that the user can
overwrite with whatever so that the text stays in the desired font?
John

This is your original code (without the comments)
Sub Mail_Outlook_With_Signature_Html()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
SigString = "C:\Users\" & Environ("username") & _
"\AppData\Roaming\Microsoft\Signatures\Test email.htm"
If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
On Error Resume Next
With OutMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.HTMLBody = strbody & "<br><br>" & Signature
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 
R

Ron de Bruin

You must add html that load the picture like this (not a good picture but you can see how it works)

strbody = "<table><td valign=""top""><img src=""http://www.rondebruin.nl/images/ron.png"" alt=""ron logo"" " & _
"width=""160"" height=""120"" hspace=""10"" vspace=""10"" align=""left"" border=""0"" /></td>" & _
"<tr><br><br><td>" & Format(Date, "dd-mmm-yyyy") & "</td></tr></table>"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top