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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to merge two csv files in a template word document?

Status
Not open for further replies.

BearPalm

Programmer
Oct 20, 2004
6
CA
Hi, everybody.
I have one input csv file and another output csv file.
I'd like to merge them into a word template document
to create a report. I'd like to write a macro in this
template document, however, I meet following problems.

1. input and output csv file names are dynamically changed,
even though input files and output files have same format
respectively.Is it possible to merge them in programming?
I mean if I use merge-mail method to create the report,
I had to use an un-changable file name(hard-code) to open
data source for defining fields. If I use same file name,
the data may be overwritten.

2. if 1 is impossible, I had to use merge-mail method
to create the report. however, I have two csv files.
Can I use the two csv files as data source?

3. if using merge-mail skill, how can I run a macro
automatically when the template document is setup?

I am quite new at VBA development ( one day?) .
When you reply this post, please give me some sample code
if possible.

Thank you very much.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top