Dynamic mail merge question

J

JP

Good morning,

I am trying to create a mail merge document with information from an
Excel spreadsheet. The ss has several hundred rows, and each field
will appear on a separate page. The rows are varying lengths and what
I would like is for Word to change the number of pages depending on
how many fields are being used. For example,

Row 1 has 12 columns of data
Row 2 has 6 columns of data

I would set up a document with 12 pages for all of the possible
fields. So the first document would be 12 pages, and the second would
be 6 pages (without 6 blank pages at the end) since the last 6 are
blank. Is there a way to ask Word to delete the empty pages after
doing the merge? i.e. if there's no merge data then delete the page?

I've googled this but haven't found anything promising.

Thanks,

JP
 
P

Peter Jamieson

Instead, you could try putting the entire text and fields for each column
within an IF field that tests whether the field is blank or not, e.g.

{ IF "{ MERGEFIELD column1 }" = "" "" "all the text and fields you want on
the page if column1 is not blank"
}{ IF "{ MERGEFIELD column2 }" = "" "" "<put a page break character here>all
the text and fields you want on the page if column2 is not blank"
}{ IF "{ MERGEFIELD column3 }" = "" "" "<put a page break character here>all
the text and fields you want on the page if column3 is not blank"
}etc.

If you have stuff such as text boxes on the page it may be difficult but
otherwise may be feasible.
 

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