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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AddOutlook Signature when sending email through MS Access

Status
Not open for further replies.

tbclbd

Programmer
May 6, 2002
33
US
I have an access 2003 app from which I can select files and attach them to e-mails. I have no problem getting Outlook to open, show the attached files. Is there a way that I can get the signature file from Outlook and add it to the body of the e-mail>
 
Outlook signatures are stored in three files in a signature directory. Here are a few notes on one possibility:

Code:
Dim em As MailItem
Dim fs As Object
Dim f As Object

Set fs = CreateObject("Scripting.FileSystemObject")

strPath = "C:\Users\" & Environ("UserName") & "\AppData\Roaming\Microsoft\Signatures\"
'This will be whatever the user has called the signature file, there will be three
strFileName = "user.htm" 'or .rtf, .txt

Set f = fs.OpenTextFile(strPath & strFileName, 1) '1=for reading
strSig = f.ReadAll

Set em = ap.CreateItem(olMailItem)
em.HTMLBody = "hi" & vbCrLf & strSig
em.Display

 
Thank you Remou. With just a couple of tweaks, I was able to get my signature into the e-mail.

Now I just have to clean up my code, and work through the security.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top