I looked at a few threads regarding this subject and this is what I came up with. Some of the examples that were given are too complicated for my understanding, eg attaching the actual signature.html file.
This code works perfectly up to displaying the email but I can't get the signature to add.
Any idea why the signature won't add?
This code works perfectly up to displaying the email but I can't get the signature to add.
Any idea why the signature won't add?
Code:
Private Sub cmdEmail_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim lngFirstName As Long
Dim Signature As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.BodyFormat = olFormatHTML
.Display
End With
Signature = OutMail.HTMLBody
strbody = "Dear " & Me.FirstName & "<br><br>" _
& "Attached are the Sale Agreement and Health Guarantee for the puppy who will soon be part of your family. Attached as well, are copies of the Vaccination <br> " _
& "Certificate, Health Check and Change of Ownership form.<br> <br> " _
& "Both the Sale Agreement and Change of Ownership forms need to be completed and signed and returned to me. <br> <br>" _
With OutMail
.To = "pierre140861@gmail.com"
.Subject = "Sale Guarantee & Health Declaration"
.HTMLBody = strbody & Signature
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub