Add Signature to Email body (1 Viewer)

Momma

Member
Local time
Tomorrow, 04:32
Joined
Jan 22, 2022
Messages
114
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?

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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:32
Joined
Oct 29, 2018
Messages
21,358
Hi. Not in front of a computer now, but did you see any examples using the Inspector object? Just curious...
 

Momma

Member
Local time
Tomorrow, 04:32
Joined
Jan 22, 2022
Messages
114
Hi. Not in front of a computer now, but did you see any examples using the Inspector object? Just curious...
I don't understand all the code, unfortunately 🤔
 

Users who are viewing this thread

Top Bottom