View Single Post
  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default How do I repeat records in a mail merge?

Word Help is the best starting point for the field codes. For other stuff to
do with field codes there are lots of places to look, but I tend to start by
looking at
a. the Word MVP site at http://word.mvps.org
b. Graham Mayor's site at http://www.gmayor.com (look for Word Tips)
c. Cindy Meister's site at http://homepage.swissonline.ch/cindymeister/site
and you will find lots of material by searching this newsgroup using the
facilities at
http://groups.google.com

Peter Jamieson


wrote in message
oups.com...
Wonderful, thank you very much got it to work. There was still a
missing brace but I figured out where to put it:

{ IF " { MERGEFIELD Course }" = ""
"" "{ SET myCourse { MERGEFIELD Course }}"
}{REF myCourse}}

Do you have any websites that give more information and examples of
these codes?


Peter Jamieson wrote:
Graham's corrected my missing brace error.

The multiline layout is simply to prevent news reader software from
breaking
up the text in a way that makes it difficult to understand. It's simpler
if
it isn't broken up into lines but should work in the multiline format
because all the new lines are outside the result values, i.e. they will
only
show up in the document when you are looking at the field codes, not the
field results.

Peter Jamieson

wrote in message
ups.com...
I tried your code and it only prints the first one, the rest are all
blank. I noticed that there was one } missing so what I typed in is
this:

{ IF " { MERGEFIELD Course }" = ""
"" "{ SET myCourse { MERGEFIELD Course }"
}{REF myCourse}}

Do I have to have it broken up as you typed it or should it be all on
one line?

Also does the spacing between {} have to be as you typed it?



Peter Jamieson wrote:
It may be simpler than I assumed.

Let's suppose you have a column in your Excel sheet called Course that
is
only filled in on the first row for each course.

In your Mailmerge main document, you could use

{ IF "{ MERGEFIELD Course }" = ""
"" "{ SET myCourse { MERGEFIELD Course }"
}{ REF myCourse }

where all the {} are the special field code braces you can insert
using
ctrl-F9, not the ones you can type directly on the keyboard.

Peter Jamieson
wrote in message
ups.com...
Yes that's basically how I have it setup. I thought about filling
in
course name and date for each candidate but I just wanted to see if
there was another way.