I would suggest merging all the names first, into an ordinary
catalog/directory merge. After you've merged to a new document, insert
section breaks between classes and put the class names in the header, or
just insert page breaks and put the class name at the top of the page.

Signature
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
> Using Word2007, I'm trying to create class rosters or a list of names of
> students for specific classes in one document. I would like to have the
[quoted text clipped - 8 lines]
> on)
> are in more than one class.
digifigi - 30 Jan 2008 17:12 GMT
Could there be a conditional statement after each section break that would
change the header?

Signature
digifigi
> I would suggest merging all the names first, into an ordinary
> catalog/directory merge. After you've merged to a new document, insert
[quoted text clipped - 13 lines]
> > on)
> > are in more than one class.
digifigi - 30 Jan 2008 17:13 GMT
Sorry, I'm trying to automate this as much as possible since there are over
100 classes.

Signature
digifigi
> I would suggest merging all the names first, into an ordinary
> catalog/directory merge. After you've merged to a new document, insert
[quoted text clipped - 13 lines]
> > on)
> > are in more than one class.
Suzanne S. Barnhill - 30 Jan 2008 20:25 GMT
If the classes are numbered, you could probably use some sort of field in
the header. Can you provide more information about how the classes are
identified?

Signature
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
> Sorry, I'm trying to automate this as much as possible since there are
> over
[quoted text clipped - 23 lines]
>> > on)
>> > are in more than one class.
digifigi - 31 Jan 2008 12:04 GMT
Each class begins with a unique identifier, i.e., 104DA, or 216HS, followed
by the name of the class. Unfortunately, each class is not in its own field.
The fields are set up by day and type of class (Wednesday full day has 6
different classes in the column or field, Thursday half day AM has 4
different classes, etc.).
I just tried an If...Then statement in the header using both equals the
total name of a class and Not Blank. Neither returned the class name
provided. And I tried just the merge field and got a blank header.
> If the classes are numbered, you could probably use some sort of field in
> the header. Can you provide more information about how the classes are
[quoted text clipped - 27 lines]
> >> > on)
> >> > are in more than one class.
Suzanne S. Barnhill - 31 Jan 2008 14:22 GMT
I don't believe you can successfully put merge fields in headers, but I may
be wrong.

Signature
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
> Each class begins with a unique identifier, i.e., 104DA, or 216HS,
> followed
[quoted text clipped - 45 lines]
>> >> > on)
>> >> > are in more than one class.
Graham Mayor - 31 Jan 2008 15:45 GMT
You are not :)
From the description of the data records you are not going to be able to
achieve this. Word merge will not work with relational databases, nor can
you extract bits of a field for use as a heading. You would need a flat data
file similar to the following:
Class1 John
Class1 Fred
Class1 Bill
Class1 Susan
Class2 John
Class2 Susan
Class3 Bill
Class3 Fred
etc. Then you might have a half decent chance of producing a merge that
displays the students agains the classes. See How to use mail merge to
create a list sorted by category in Word 2002 -
http://support.microsoft.com/?kbid=294686
You may however be able to achieve what you want by producing a report from
your database application eg Access, that would give the required layout.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I don't believe you can successfully put merge fields in headers, but
> I may be wrong.
[quoted text clipped - 63 lines]
>>>>>> --
>>>>>> digifigi
It sounds like you need a One-to-Many merge. Here are a couple articles that
might help with this task:
http://support.microsoft.com/default.aspx?scid=kb;en-us;211303
http://homepage.swissonline.ch/cindymeister/mergfaq1.htm (see Group items
for a single condition)
If your Excel data also contains the class in each student record then it
might be easier to import the Excel data in Access and create your report.
Access is better-suited for Grouping and Sorting and that's what you are
looking for.
Please post all follow-up questions to the newsgroup. Requests for
assistance by email cannot be acknowledged.
~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
Coauthor of Word 2007 Inside Out:
http://www.microsoft.com/MSPress/books/9801.aspx#AboutTheBook

Signature
Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
> Using Word2007, I'm trying to create class rosters or a list of names of
> students for specific classes in one document. I would like to have the
[quoted text clipped - 8 lines]
> on)
> are in more than one class.