0

I have an Excel spreadsheet Auditing Vendor documentation with expiry dates. I have created an VBA macro which when I choose (Ctrl + M) will send an email requesting updates for specific documents based on the expiry dates.

Everything is beautiful and works like a charm.

My question is how do I include an Outlook Signature at the end of the email? I would like it to pick up based on whoever has the spreadsheet open so that if Charlie Brown wants to trigger an email it would include Charlie Brown's Signature at the end.

It already auto-fills Charlie Brown as the Sender so I should be able to do this.

Any suggestions?

0m3r
  • 12,286
  • 15
  • 35
  • 71
Ted Almond
  • 45
  • 2
  • 4
  • The downvoter might have been more charitable had you included information about the code rather than the button pressing. This could be useful http://stackoverflow.com/questions/8994116/how-to-add-default-signature-in-outlook – niton Feb 22 '16 at 23:03

2 Answers2

0

If you use excel to grab the new mail item signature you will get a flag for suspicious activity that the user could acknowledge

Dim OApp, OMail As Object
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)

Dim sig As String
sig = OMail.HTMLbody

If you know the name of the signature you can go browse for it

Dir (CStr(Environ$("userprofile")) & "\appdata\roaming\microsoft\signatures\")
Clyde
  • 193
  • 7
0

Here is an Example

Option Explicit
Sub AddSignature()
    Dim olApp As Object
    Dim olMail As Object

    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(0)

    With olMail
        .Display olMail.HTMLbody '<- adding default signature
    End With

    With olMail
        .To = ""
        .CC = ""
        .BCC = ""
        .Subject = ""
        .HTMLbody = "Hello." & "<br>" & .HTMLbody '<- adding default signature
        .Display
'        .Send
    End With

    Set olMail = Nothing
    Set olApp = Nothing
    End Sub

also see Insert Signature in mail From Ron de Bruin

0m3r
  • 12,286
  • 15
  • 35
  • 71