Using InsertFile method of the Range object to add attachments to email created from inside Word.

  • Thread starter Viktor Barabanov
  • Start date
V

Viktor Barabanov

Hi everybody,
I have the following problem - I need to create the mail message from inside
the Word (programatically, using Word as the automation server) then I need
to to attach to this message a bunch of other attachments. The MailMerge
object doesn't support any attachments.
I tried to use InsertFile method of the Range object - it receives the
parameter Attachment and accordig to MSDN if this parameter is True, the
method attaches the specified file to the email message - but this method
always inserts the text from specified (attached) file into the body of the
main file (main file - the parent of the Range object). The method
AddOLEObject of the Shape method appeared to be a bit more useful - at least
it embedds the specified file into the body of the main documet as a nice
icon, which can activate the embedded file. But when i try to send the file
with the embedded object - the word strips the embedded object and in the
email message I have only the icon which is no longer pointing to the
embedded file.

So the question is - is it possible at all to create programatically Word
document, attach soem other documents to it and then to send it by email
without using specific email client as an automation server? seems that it
is not possible - email message it is just html message and there is no
means to attach something else to html document.

Thanks for your time and consideration
Viktor Barabanov
 
D

Doug Robbins - Word MVP

Hi Viktor,

See the article "Mail Merge to E-mail with Attachments" at

http://www.mvps.org/word/FAQs/MailMerge/MergeWithAttachments.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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