View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Dynamic mail merge question

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 hereall
the text and fields you want on the page if column2 is not blank"
}{ IF "{ MERGEFIELD column3 }" = "" "" "put a page break character hereall
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.
--
Peter Jamieson
http://tips.pjmsn.me.uk

"JP" wrote in message
ps.com...
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