Merging Text documents to Word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have a dos based data base that creates letters in a txt format. We may
have a number of these letters generated in any given day - could be from 1
to 50. We want to be able to automate taking each text file and putting it
in a separate word document and then being able to print those separate
letters.

Can this be done my merging or is there some thing else we need to do to get
this task done.

Your help is appreciated.
 
Hi =?Utf-8?B?RkwgQ29uc3VsdGFudA==?=,
We have a dos based data base that creates letters in a txt format. We may
have a number of these letters generated in any given day - could be from 1
to 50. We want to be able to automate taking each text file and putting it
in a separate word document and then being able to print those separate
letters.
This would require a macro (VBA automation) solution. Probably, you could use
the InsertFile method.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Cindy,

That sounds great but can you give me some more details. I don't have a
problem using Macros but how about an example or some MS doc to look at.

Thanks for your help.
 
Hi =?Utf-8?B?RkwgQ29uc3VsdGFudA==?=,
That sounds great but can you give me some more details. I don't have a
problem using Macros but how about an example or some MS doc to look at.
Here's some code (typed off the top of my head, so watch out for typos). It
creates a new document, inserts a file, saves and closes. I'd think you'd want to
save all docs to a single folder that you could "walk" to open each file and print
it.

Sub MakeDocFromTextFile()
Dim doc as Word.Document

Set doc = Documents.Add
doc.Range.InsertFile _
FileName:="C:\path\file.txt", _
ConfirmConversions:=false
doc.SaveAs "C:\path\file.doc"
doc.Close SaveChanges:=wdDoNotSaveChanges
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)
 
Thank you for sending me an example. Also I do understand that people
respond when they can but you should not take this personally because I asked
for more help. I actually got a different response.

I am grateful for the people that look over the messages and take the time
to respond. I am surprised some times at the depth of the information that
is provided. From you're response you seem a bit defensive. So please
understand, from my part I am grateful and I appreciate the suggestions.

I have tried to reponsed to a couple messages myself and I hope that as my
knowledge increases that I can respond more often. It is not possible for
everyone to have all the answers.

Thank you for your help.
 

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

Back
Top