Add Signature to HTML email using VBA
Can someone help me figure out how to add my standard signature to an email I create and send using VBA. I can get everything I want but that piece. Thanks.
If MsgBox("Send Email?", vbYesNo + vbQuestion, "Email") = vbYes Then
Dim myOutlok As Object
Dim myMailItm As Object
Dim signature As String
Set otlApp = CreateObject("Outlook.Application")
Set OtlNewMail = otlApp.CreateItem(olMailItem)
signature = OtlNewMail.HTMLBody
OtlNewMail.HTMLBody = signature
.To = Range("H9").Value
.CC = Range("H10").Value
.Subject = Range("H11").Value
.HTMLBody = "Hello," & "<br />" & Range("H12").Value & "<br />" & "<br />" & "<br />" & "Thank you," & "<br />" & "<br />" & signature
'.Attachments.Add "U:\CRAIG\Actual\" & Range("H6").Value & "\" & Range("H8").Value & "\" & Range("H13").Value & ".xls"
Set OtlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
fixing missing image problem
In the .htm file in the signatures directory you can edit the htm file. The pictures are stored as relative path and when you use the code it looses that path so if you use discrete path it will be able to find the pictures. so go into the file and look for any relative paths and make them discrete.
Originally Posted by Maudibe
change that to include the whole path
This solved the missing image problem for me.