PDA

View Full Version : sendmail button in a word document



scorney
10-09-2007, 06:40 AM
Hello,

I'm having a hard time to built a button that would send an email automaticaly to a pre-define list included in the code.
Here is what I've done so far:

Private Sub CommandButton1()
ActiveDocument.SendMail
With ActiveDocument.MailEnvelope.Item
.Recipients.Add "scorney@isp.com"
.Recipients.Add "scorney@isp.ca"
.Subject = "I Approved the MOP."
End With
End Sub

I've changed the security to Medium and it work once but then nothing...
It copied the word file into the email and I could put .send to send it automaticaly without having anyone editing the email before send...

What do you think it can be the problem ?
Thanks,
Sylvain

fumei
10-09-2007, 06:59 AM
Please mention it when you have cross-posted. You essentially have this same request at Tek-Tips.

BTW: you should probably put the SendMail instruction at the end.

lucas
10-09-2007, 08:06 AM
Click here (http://www.excelguru.ca/node/7) for an explanation of cross-posting