View Single Post
  #1   Report Post  
Gary Jones
 
Posts: n/a
Default 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