Send an email from Outlook using Excel VBA with default signature included

Background

Skillname
55%

In order to send emails from Excel, you need to connect to Outlook. This is quite straightforward, but you may also want to include your default signature without having to recreate it, or refer to a seperate file.

The following process will allow you to send an email from your default Outlook account (although you can change the from email address to another account), using the default Outlook signature for that account. This is the easiest way to use the default new email signature for the default email account on Outlook. You can also manipulate a HTML signature to add in extra information, if required, but it is not included in the below.

You can display or automatically send the email – however the Display option must rename enabled otherwise it cannot extract the signature. It can still auto-send but the email will flash briefly in front of you before sending.

Option Explicit

Sub Send_Email_With_Signature()

 'Created by FormatCells.com
 'For more free tools, see http://www.formatcells.com/useful-tools/
 'Working on Office 2007 - 2016

 Dim objOutApp As Object, objOutMail As Object
 Dim strBody As String, strSig As String
 
 Set objOutApp = CreateObject("Outlook.Application")
 Set objOutMail = objOutApp.CreateItem(0)
 
 On Error Resume Next
 With objOutMail
 
 'SET THE EMAIL CONDITIONS
 .To = "example@formatcells.com"
 .CC = ""
 .BCC = ""
 .Subject = "Subject Line"
 
 'ADD ATTACHMENTS
 '.Attachments.Add ("C:\Users\FormatCells\Documents\MyTestDoc.txt")
 
 'IF SENT FROM ANOTHER EMAIL ACCOUNT (MUST ALREADY BE SETUP)
 '.SentOnBehalfOfName = "AnotherAccount@FormatCells.com"
 
 'CHECK NAMES, ENSURES INTERNAL EMAIL ADDRESSES EXISTS IN ADDRESS BOOK
 .Recipients.ResolveAll
 
 'DO NOT REMOVE - THIS MUST BE VISIBLE FIRST TO GET THE DEFAULT SIGNATURE
 .Display
 
 'GET THE HTML CODE FROM THE SIGNATURE
 strSig = .Htmlbody
 
 'WHAT SHOULD THE EMAIL SAY, ON TOP OF THE SIGNATURE
 'HTML TAGS CAN BE INCLUDED HERE
 strBody = "<font face=Tahoma size=3> This is what I want the email to say. </calibri> <p>" & _
 "<font color=green> For additional support, tips, or Excel consultation, " & _
 "please visit: <a href=http://www.formatcells.com> formatcells.com.</a></font>"
 
 'COMBINE THE EMAIL WITH THE SIGNATURE
 .Htmlbody = strBody & strSig
 
 'IF YOU DO NOT HAVE HTML IN THE BODY, USE THIS INSTEAD
 '.Body = strBody & strSig
 
 'AUTOMATICALLY SEND EMAIL (IT WILL STILL BRIEFLY POPUP)
 '.Send
 
 End With
 
 On Error GoTo 0
 Set objOutMail = Nothing
 Set objOutApp = Nothing

End Sub