Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Multiple Document Templates and One Data Source
Hi, I'm hoping someone can suggest the best way to do this mail merge.
There is one database which contains the data for the merge and there are 10 different Word documents. For any entry in the database, depending on the contents of a particular field, I would like to merge that entry with one of the ten documents. For example, if the 'Letter' field contains A, I would like to merge that with document 1, B with document 2, etc. The simplest way I can think of is to do 10 separate merges each based on a query but that is not ideal. It is time consuming since it will need to be done regularly and, also, I need the final output to be sorted based on a merged number field. I was thinking I could combine the separate documents into one but I don't know of any way to perform a mail merge selectively on different pages of a document. Any suggestions are appreciated. Thanks. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Multiple Document Templates and One Data Source
The simplest way I can think of is to do 10 separate merges each based on
a query but that is not ideal. I also think it is the simplest and the most maintainable. You can also consider using a document containing nothing but an INCLUDETEXT to include the appropriate document depending on a value in your data source. e.g. { INCLUDETEXT "c:\\myletters\\{MERGEFIELD LETTER}.DOC" } There's even a Microsoft KB article somewhere about this approach. However, I think it worked better in older versions of Word and you need to test it thoroughly. It really relies on the page layout being the same for each document and stuff like that. You may even find that you need separate INCLUDETEXTs for the header and for the footer. You could probably do something similar by using a macro to execute one merge for each record in the data source, using VBA to replace /all/ the text and layout in the mail merge main document by the text/layout you want immediately before you perform the merge. If you search this group using Google groups and e.g. Peter Jamieson activerecord you should find some macros that do a separate merge per record, but I've never done that "replace the complete document content" thing. Peter Jamieson "jcl" wrote in message ... Hi, I'm hoping someone can suggest the best way to do this mail merge. There is one database which contains the data for the merge and there are 10 different Word documents. For any entry in the database, depending on the contents of a particular field, I would like to merge that entry with one of the ten documents. For example, if the 'Letter' field contains A, I would like to merge that with document 1, B with document 2, etc. The simplest way I can think of is to do 10 separate merges each based on a query but that is not ideal. It is time consuming since it will need to be done regularly and, also, I need the final output to be sorted based on a merged number field. I was thinking I could combine the separate documents into one but I don't know of any way to perform a mail merge selectively on different pages of a document. Any suggestions are appreciated. Thanks. |