Tom Crowfoot
asked on
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?
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?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.Appl ication")
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
Function SendEmail
Dim OApp As Object, OMail As Object, signature As String
Set OApp = CreateObject("Outlook.Appl
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
ASKER