automatic mail-merge to saved document

D

Dennis

I already have a Word document that does mail-merge from a .txt file, this
works fine. What I'd like to do is automate the process so that the user
doesn't have to click the "merge to new document" button. I'd also like to
automate the Save process so that as soon as the document is merged, the new
document is saved as a Word document. Ideally, I'd like to control the name
of the new document each time by assigning it a date/time stamp name, or
something similar. The main objective is to automate the process so that
when the merge document opens, it automatically performs the merge, then
automatically saves the resulting document to a new (unique) name, then
automatically closes the original document. Simple? Macro?

For example; I have a mail merge document named notice1.doc that has a data
source (.txt file) defined and all of the associated mail merge info ste up.
What I would like to happen is when the user opens notice1.doc, it opens
Word, opens notice1.doc, performs the mail merge, saves the new document as
yyyymmdd-hhmmss.doc, then closes completely.

Thanks for anyone that can help.
 
D

Doug Robbins - Word MVP

See the "Individual Merge Letters" item on fellow MVP Graham Mayor's website
at:

http://www.gmayor.com/individual_merge_letters.htm

If you are using Word XP or later, the "Add-in to Merge Letters to Separate
Files" that I have written and that can be downloaded from that site will
allow you to create each letter as a separate file with a filename taken
from a field in the data source with a minimum of fuss.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

Actually, the add-in is mine too. Graham graciously makes it available from
his website.

It is certainly possible to modify the add-in so that the mergefield that
contains the field name is hard coded into it. Of course, it will only then
work if such a field is included in the data source.

After unchecking the box against the add-in in the Tools>Templates and
Add-ins dialog, you can open the file via File>Open and then go to the
Visual Basic Editor (Alt+F11) and make whatever changes you wish (at your
risk).

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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