Sending mail from Word automation
Hello everyone,
From an acces database, I generate detailed MS Word documents, which are printed afterwards.
A next step would be to automatically email the resulting documents to a fixed list of recipients, preferrably with "read receipt" option activated.
In a later stadium, encryption of the email message would be required.
Does anyone have some good pointers for me for good documentation or examples of this ? Can I use the Word.mailer for this ?
Thank you,
Phaedra
Re: Sending mail from Word automation
What email program are you using? If Outlook you can create an Outlook object and use that to mail the Word docs as attachments.
If the docs you email don't have to be the Word docs themselves, you can use SendObject in Access to email reports, which are in .rtf format, but SendObject doesn't support attachments.
You could also use smtp (I think that's what it's called), but I've never used that.
Re: Sending mail from Word automation
Hello,
I have experimented with the options you mentioned, but they are insufficient for my needs :
- I don't want to save the generated document and send it as an attachment : I want to email it directly, in the body of the email message
- the sendObject method doesn't allow you to fine-tune the email options as the Word.Mailer object.
That's why I'm looking for documentation / examples / tips / .... about this object (or alternatives ?)
Thanks,
Phaedra
Re: Sending mail from Word automation
Something like this should get you started.
VB Code:
ActiveDocument.MailEnvelope.Item.Introduction = "Test"
With ActiveDocument.MailEnvelope.Item
.Subject = "Here is the document."
.Send
End With
Re: Sending mail from Word automation
Thank you for the code in the last post, Rob.
I got it working with that.
From my Access db I create the Word document, which contains complex formatting.
I then prepare the message parameters (recipients, subject, intro), after which I show the generated document (preview before sending), which contains a command button.
Clicking this command buttond causes the document to be sent, after the button has deleted itself.
The one thing I can't seem to find is how to set the message option to ask for a read receipt (Outlook is the default email program). Any ideas ?
Thanks again, you've been a great help.
Phaedra
Re: Sending mail from Word automation
I thought I may have done something with that before. Lets search for it on the Forums. Post the link if you find it beofre me. ;)