Mail merge

J

Jan Hart

How to, in the merge process, automate the insertion of a
page break when the value in a field changes.
 
P

Peter Jamieson

Typically, you have to save the value of the field so that you can see if it
has changed. So e.g. if your field is called myfield, you save the current
value in a bookmark called prevmyfield, then use it the next time around.

So at the beginning you need to make sure savmyfield has a value...

{ IF { MERGESEQ } = 1 "{ SET prevmyfield "" }" "" }

(If myfield can be blank, you would need to choose a starting value for
prevmyfield that myfield never has, e.g. "¬" or something.

Then you can compare

{ IF { MERGEFIELD myfield } <> { REF prevmyfield } "<page break character>"
"" }

Just insert a page break character in the usual way within the IF field
between the "" where I have put <page break character>.

Then, after the last point where you need to compare with savfield, save the
current value of myfield:

{ SET prevmyfield { MERGEFIELD myfield } }

NB, all the {} need to be the special field braces you can insert using
ctrl-F9.
 

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