Simulating File>SendTo>MailRecipient using VBA/VB6

G

Gordon Filby

Hi,

Using an email address + other data I grab from a web page and a
user-defined template I generate a Word document which I would like to send
automatically simulating the File>SendTo>MailRecipient sequence. I can get
all the stuff I need in the body of my mail (using bookmarks) but I can't
see how to send off the mail.

Can anyone help? Thanks in advance.
Gordon Filby
 
S

SA

Gordon:

Word's file -> sendto -> mail recipient always displays the mail item before
sending waiting for user interaction.

You can use a simple api call to MAPISendDocuments to simulate this pretty
simply or you can use Word's built in functions to do the same.

If you want to send mail without user interaction, you'll need to either use
an ActiveX MAPI control or program Outlook combined with a tool like
Outlook Redemption to avoid the built in security prompts
 
G

Gordon Filby

Hallo Steve,

Thanks for the reply.

SA said:
Gordon:

Word's file -> sendto -> mail recipient always displays the mail item before
sending waiting for user interaction.

Yup, I've noticed that. That is exactly what I'm trying to avoid.

Perhaps I should add that the user-defined template is in Cyrillic and I'm
dropping data (author's name, title and source journal of his/her
publication, email) extracted (VBA/VB6) from an online scientific database
in "normal" text.
You can use a simple api call to MAPISendDocuments to simulate this pretty
simply or you can use Word's built in functions to do the same.

Could you elaborate on this a little please? Where can I find information on
MAPISendDocuments ? Which Word built in function? I can put up with the
security prompts but it is having to type in the email address and the
subject line when I already have them that is so annoying.

This doesn't sound like such an outlandish thing to want to do - shouldn't
there be code already out there?
If you want to send mail without user interaction,

Yes, that is exactly what I want to do! Don't want to start fiddling with
Redemption for a single one-off job like this.

you'll need to either use
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top