Add Signature to Email body (1 Viewer)

Momma

Member
Joined
Jan 22, 2022
Messages
117
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
 
Hi. Not in front of a computer now, but did you see any examples using the Inspector object? Just curious...
 
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