Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice please for VBA using several Word Templates

Status
Not open for further replies.

newboy18

MIS
Apr 11, 2003
45
GB
Please help, I have created a working Access VBA routine that searches through a query for customer Email Name and Product Type in that order and sends an email to each customer with a data sheet for each product attached.
There are 9 different data sheets held as Word templates
and each attachment needs to be edited with some unique
data for that customer.
My routine creates a temp folder and then, for each customer, depending on the product type opens the correct .DOT file, edits it, saves it with a new name, and then closes it, this loops until the next customer is found, at that stage all the files in the folder are attached to the email and sent, then the folder is cleared ready for the next customer.
The problem is that the files can't be attached to an
email if they are still open so I have to keep opening and
closing the templates, is there a better, more efficient
way to do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top