Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Apr 2004
    Thanked 0 Times in 0 Posts

    E-mailing Word attachment with VBA (VBA)

    My goal is to export an Access form to Word, using VBA to build the Word document by assigning data from the Access form fields to bookmarks in a Word document formatted to look like the Access form, send to send the filled in Word document as an e-mail attachment in Outlook. After producing the 'New Message' form in Outlook (with the attachment) I want Word to close (either without saving the generated Word file, or to close, and then delete the saved Word file using VBA code. I've done the first few steps, up through generating the completed form in Word. I've been trying to use the ActvieDocument.SendMail method to send the completed form; the New Message form in Outlook comes up with the correct attachment, but the user gets an error message, saying that the e-mail message needs to be sent before Word can close; hanging the procedure. Any advice as to how to simply open a 'New Message' window in Outlook with the attachment embedded, and have Word closed in the VBA code?
    thanks - Mark

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Salt Lake City, Utah, USA
    Thanked 5 Times in 5 Posts

    Re: E-mailing Word attachment with VBA (VBA)

    It might be helpful if you post the relevant part of your code. See if <!post=this post on sendmail,114888>this post on sendmail<!/post> and <!post=this post on creating an instance of Outlook,265997>this post on creating an instance of Outlook<!/post> (where you would add the ActiveDocument as an Attachment rather than an externally referenced Excel Worksheet as in that example) are of help.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts