grouping and page breaks in a merge

T

Tom

I am trying to get a mail merge to put city into a table, show all records
for the city into a second table on the same page and then start a new page
whenever the city changes.

I tried to use the following code from Microsoft KB but it does not work:


{ If { MERGESEQ } = "1" "{ MERGEFIELD CITY }¶
" ""}{ SET Place1 { MERGEFIELD CITY }}¶
{ If { Place2 } <> { Place1 }"¶
----------------------------Page Break--------------------------------
{ MERGEFIELD CITY }¶
¶
{ MERGEFIELD EMPLOYEE } { MERGEFIELD SALES }" "{ MERGEFIELD EMPLOYEE } {
MERGEFIELD SALES }" }{ SET Place2 { MERGEFIELD CITY }}¶

I pasted the code as if from Microsoft's website becuase I could not figure
out out to create the formulas.
 
G

Graham Mayor

You cannot paste fields from a KB article, you have to recreate them using
CTRL+F9 for each pair of field boundaries {}


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
T

Tom

I can get Word to create the brackets using CRTL F9 but I can't seem to get
it to create the expression inside the brackets as follows:

{ If { MERGESEQ } = "1" "{ MERGEFIELD CITY }¶
 
G

Graham Mayor

What you have here is part of a field sequence (which continues on the line
you have not pasted). The pilcrow '¶' merely indicates that you should press
the enter key at that point. The rest you will have to type between the
field brackets.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Doug Robbins

Select each portion of the text that you want enclosed in field delimiters
and Press Ctrl + F9 or use Ctrl + F9 to insert each pair of empty field
delimiters and then use the keybaord to create the required expression.

--
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
 

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