Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook signature through Excel

Status
Not open for further replies.

exRP12Nuke

Technical User
Oct 5, 2011
49
US
Good Afternoon,

In Excel 2010 there is a function to send the spreadsheet you are working with to an Outlook mail message as an attachment, which works perfectly. However, when the mail message appears it does not contain my signature as it normally would if I were to create a new mail message through Outlook. I have been searching around the web for some VBA to take my signature file and place it in the Excel created mail message, but I have had no luck.

Do any of you have the code required to make the signature appear in this case?

Thanks!
 
The code below will create an outlook message & keep the auto signature

Code:
Dim OApp As Object, OMail As Object, signature As String
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
    With OMail
    .Display
    End With
        signature = OMail.body
    With OMail
    '.To = "someone@somedomain.com"
    '.Subject = "Type your email subject here"
    '.Attachments.Add
    .body = "Add body text here" & vbNewLine & signature
    '.Send
    End With
Set OMail = Nothing
Set OApp = Nothing

 
Maddonac,

Thank you for helping out with that. One last question though...in order for the routine to run when the email button is pushed on the quick access toolbar, Sub SendEmail() does not seem to work unless I go and manually run the macro. What do I need to title the routine as for it to be automated?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top