0

I am using the code below to create an email from Excel:

Sub TEST()

Dim outlook As Object
Dim newEmail As Object

Set outlook = CreateObject("Outlook.Application")
Set newEmail = outlook.CreateItem(0)

With newEmail
    .To = Sheet1.Range("L2").Text
    .Subject = Sheet1.Range("E1").Text

    ' .Body = "" & vbNewLine & signature
    .Display

    Dim xInspect As Object
    Dim pageEditor As Object

    Set xInspect = newEmail.GetInspector
    Set pageEditor = xInspect.WordEditor

    Sheet1.Range("B4:L37").Copy

    pageEditor.Application.Selection.Start = Len(.Body)
    pageEditor.Application.Selection.End = pageEditor.Application.Selection.Start
    pageEditor.Application.Selection.Paste

    Set pageEditor = Nothing
    Set xInspect = Nothing
End With

Set newEmail = Nothing
Set outlook = Nothing

End Sub

My signature will automatically appear before the text body.

Is there a way to insert my signature afterwards?

Community
  • 1
  • 1
ToySoldier
  • 25
  • 5

1 Answers1

0

Create the Signature in a new sheet in Excel and have it added to email body, same as you did for body contente, this is better to customized signature.

Else you can use this idea:

if  Not (Account  Is  Nothing)  Then
   set Signature = Account.NewMessageSignature
   if  Not (Signature  Is  Nothing)  Then
    Signature.ApplyTo Msg,  false   'apply at the bottom
   End If
End If

From this post: How to add default signature in Outlook

ROCA
  • 81
  • 8