PDA

View Full Version : Solved: Attaching Document to e-mail



uksrogers
01-17-2007, 02:56 AM
Hi there,

I have recently written an add-in for word that incorporates a button on a tool bar. When the button is pressed it saves the current document to a temporary location and then attaches it to an e-mail as an attachment using the ActiveDocument.Sendmail function.

When presented with the e-mail, the signature is not being included on the e-mail. Does anyone know if it is possible to change this so the signature is included?

uksrogers

matthewspatrick
01-17-2007, 07:31 AM
You will probably have to use Outlook automation to generate an email with the signature.


Dim olApp As Object
Dim olMsg As Object

Set olApp = CreateObject("Outlook.Application")
Set olMsg = olApp.CreateItem(0) 'olMailItem
With olMsg
.Body = "something"
.Subject = "something"
.Recipients.Add "someone"
.Attachments.Add "path and file name"
.Send
End With

Set olMsg = Nothing
Set olApp = Nothing

uksrogers
01-17-2007, 08:06 AM
Patrick,

Had a feeling it would be along those lines. The code wasn't as complicated as i feared. Thanks for the response.

uksrogers

matthewspatrick
01-17-2007, 08:14 AM
Glad to help. Don't forget to mark this 'solved' if you think we're done ;)