Access MVP (2010-2015)

oOo.oOo.oOo.oOo.oOo.oOo

Send eMail with Default (Outlook) Signature…

Question: How do I send eMail and include my Outlook signature?

Answer:
Create a Module, name it anything you like except the name of the Function.

At the top of your Module under…

Option Compare Database
Option Explicit

…place

Function streMailWithOutlookSignature()
'Works in Office 2000-2016
    
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String

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

    strbody = ""

    On Error Resume Next

    With OutMail
        .Display
        'Sets the From
        .To = "Fill in an eMail Address"
        'To use a Distribution List put the name of the list on the *To* line
        '.To = "Name of Distribution List goes here"
        .CC = ""
        .BCC = ""
        .Subject = "This is the Subject line test"
        .HTMLBody = strbody & "
" & .HTMLBody
        'Stopped from automatically sending
        '.Send
    End With

    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing

End Function

 713 total views,  1 views today

Comments are closed.