Add Signature to Email Macro

O177812

Board Regular
Joined
Apr 16, 2015
Messages
93
Office Version
  1. 365
  2. 2021
Hi,

Wrote a macro that creates a file and then emails the file to the appropriate parties.
I am trying to make sure my signature is included in the email but I have been stumped.
Below was my last attempt:

------------------------------------------------------------------------

Dim OutMail As Object, signature As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

signature = OutMail.HTMLBody

With OutMail
.To = "scott.hogan@company.com, adam.landman@company.com"
.CC = "shelly@company.com"
.Subject = "XXXX - OPEN ORDER DASHBOARD - " & Format(Now, "mm-dd-yyyy")
.HTMLBody = "Hi Company Team," & Chr(10) & "<br>" & "<br>" & _
Chr(10) & "Attached is an updated dashboard reflecting your open orders. " & "<br>" & _
Chr(10) & "Please review at your earliest convenience and let me know if I can provide any clarity or answer any questions you may have." & Chr(10) & Chr(10) & "<br>" & "<br>" & _
Chr(10) & "Have a great week!" & vbNewLine & signature
With .Attachments.Add("https://xxxxxx.sharepoint.com/sites...ustomer Pricing/Company/1_Open Order Reports/" & "Company Dashboard " & Format(Now, "m.dd.yy") & ".xlsx")
.DisplayName = Replace(.DisplayName, "%20", " ") '<<<<<
End With
.Display
End With

End Sub

----------------------------------------------------------------------------

Please help! :)
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
it's the HTML in your signature. Put the new body in its own variable, don't use your signature variable. Like this:

VBA Code:
   tmpBody = "Hi Company Team," & Chr(10) & "<br>" & "<br>" & _
         Chr(10) & "Attached is an updated dashboard reflecting your open orders. " & "<br>" & _
         Chr(10) & "Please review at your earliest convenience and let me know if I can provide any clarity or answer any questions you may have." & Chr(10) & Chr(10) & "<br>" & "<br>" & _
         Chr(10) & "Have a great week!"
   .htmlbody = tmpBody & vbNewLine & .htmlbody
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top