• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1045
  • Last Modified:

Access to send Emails with Outlook signature block

Dear Experts

I'm using Access 2010 & Outlook 2010 & am keen to send emails from the Access Db I'm building, but want to the emails to be sent out to include the user's Outlook Signature Block.  

I'm keen not to create the signature block inside Access as a number of different users will use this Db, each of them has their own outlook signature block (which does contain images).

Can anyone help?
3 Solutions
Jeffrey CoachmanMIS LiasonCommented:
Meaning you want to use that users "Distinct/Custom" signature that they created?
(See JEREMYNO's link...)
So if using that code, Your app would have to be able to retrieve that info for each sender. (possibly by looking up the user name via a Dlookup function

Dim strUser Name as String
Dim strSigFileName
strUser =Dlookup("UserName", "tblUsers","userID=" & lngUserID
SigString = "C:\Users\" & strUser & "\AppData\Roaming\Microsoft\Signatures\AnneTroyHT.htm"

*However* As you can see from what I highlighted, you would also need to know the *exact name* of this file on each users machine... then look that up too (if this is even possible)

It might just be easier to just insert a Generic signature for each user"

Since you did not post any code you are using, nor did you state if this was an HTML email, ... it is hard to give you the exact code, but it would be something like this at the end of your code:

Dim strUser Name as String
Dim strSigFileName
strUser =Dlookup("UserName", "tblUsers","userID=" & lngUserID)
.Body=strYourEmailString & "Thank You, " & strUserName

So basically you would tack this "signature" string at the end of your email text

correlateAuthor Commented:
Thanks very much for all your help - managed to get this to work relatively easily - I also put in a simple browse feature at the start which took the user to the signature block folder so they could pick the relevant one (which took care of naming variations in their signature blocks)
Found a really easy way to include the standard signature block. Just display a blank message first, save it to a variable and then add it again before sending. It works with both standard and HTML emails. This code can be adapted to more complex email functions easily

Function SendEmail
    Dim OApp As Object, OMail As Object, signature As String
    Set OApp = CreateObject("Outlook.Application")
    Set OMail = OApp.CreateItem(0)
        With OMail
        End With
    signature = OMail.body     'save standard signature block in text format OR
    signature = OMail.HTMLbody     'save standard signature block in HTML format

    With OMail
       .To = "someone@somedomain.com"
        .Subject = "Type your email subject here"
        .body = "Add body text here" & vbNewLine & signature      'add saved signature after your text in text format OR
        .body = "Add body text here" & "</br></br>" & signature      'add saved signature after your text in HTML format
    End With
    Set OMail = Nothing
    Set OApp = Nothing
End Function
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now