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?
correlateAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
0
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

JeffCoachman
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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)
0
Rob4077Commented:
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
            .Display
        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"
        .Attachments.Add
        .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
        .Send
    End With
    Set OMail = Nothing
    Set OApp = Nothing
End Function
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.