How Might I "Mail Merge" Data For Multiple .txt File Output?

T

tim.j.hart

Instead of mail merging a list of addresses with a letter, my goal is
to combine a list of data with a text file (actually an .XML script) to
make a number of seperate .txt files, each with one of the data lines
imbedded.

One could concievably do this in a straightforward way in MS Word,
except that Word will let you send output either to a printer, to
email, or to a SINGLE large output file. I want to crank out dozens of
individual text files, one for each member of the input data file.

I am an avid Excel user, but, ahem, a very poor macro programmer.
Could you suggest a macro script that would run this mail-merge-like
function?
 
T

Tom Ogilvy

If you already have a text file, you can use low level file io to read it
in, then loop through your data and write out a similar file, inserting the
appropriate additional line.

http://support.microsoft.com/default.aspx?scid=kb;en-us;151262
Working with Sequential Access Files

http://www.applecore99.com/gen/gen029.asp

http://web.archive.org/web/20040405...scid=/support/excel/content/fileio/fileio.asp
File Access with Visual Basic® for Applications

http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=622

You can also use the scripting runtime (Textstream object)

http://msdn.microsoft.com/library/d...html/0fd59100-adcf-441d-8fa5-5e0800ad34d6.asp
 

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