Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Merge csv file into dynamic table
I have an application that generates a csv file from a sql database. I want
to be able to merge this data into a table within a word document. The problem i have is that the csv could have any number of records, and ideally i do not want to create a table that is three pages long if there are only a handful of records, and if i have more records than rows in the table, it will just merge into a new page. I've used Next Record If to check for blank rows to get the rows into the table but i don't want the table longer than necessary. Alternatively, is there a way to merge without throwing the page break? And before somebody says about just inserting the csv file as an object - the csv file is given a dynamic name (datetime/job number stamped), and the mail merge is part of an automated process so i can't just embed the file |
#2
|
|||
|
|||
Use a catalog (or in XP and later it is called, directory) type mailmerge
main document in which you have a single row table, the cells of which contain the mergefields. When you execute that merge to a new document, you will get a table containing a row for each record in the datasource. -- 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 "Gary Jones" wrote in message ... I have an application that generates a csv file from a sql database. I want to be able to merge this data into a table within a word document. The problem i have is that the csv could have any number of records, and ideally i do not want to create a table that is three pages long if there are only a handful of records, and if i have more records than rows in the table, it will just merge into a new page. I've used Next Record If to check for blank rows to get the rows into the table but i don't want the table longer than necessary. Alternatively, is there a way to merge without throwing the page break? And before somebody says about just inserting the csv file as an object - the csv file is given a dynamic name (datetime/job number stamped), and the mail merge is part of an automated process so i can't just embed the file |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sending Mail Merge to Email to Multiple Recipients in the Same Mes | Mailmerge | |||
INCLUDETEXT File is Determined by Merge Field | Mailmerge | |||
How to creat relative and shorthand file path names? | Microsoft Word Help | |||
Templates | Page Layout | |||
Table headers/footers and layout | Page Layout |