This is fairly straightforward to achieve in the merge document by using a
series of conditional fields to place the title and line feed only when
there is content. All the conditional fields are placed on the same line eg
{IF {Mergefield Title1} <> "" "{Mergefield Title1}
"}{IF {Mergefield Title2} <> "" "{Mergefield Title2}
"}{IF {Mergefield Title3} <> "" "{Mergefield Title3}
"}etc
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
BuzzMaster wrote:
> I have a web application built in Cold Fusion that generates a
> listing of books for each student in the school. The school wants to
> generate a mailing through Word for these book lists. The number of
> books varies for each student. I currently determine the student
> with the most number of books and then dynamically generate fields
> for book titles, equalling this total number. I then generate a
> record for each student where the titles are loaded sequentially in
> each field until there are no more titles, and then I load a blank
> character into each subsequant field up to the max number of titles.
>
> This data is then saved a a .txt file to use as my data source for
> the mail merge. Each field is double quoted and separated by commas.
>
> I then have to create a Word template with the right number of fields
> to merge into.
>
> What I would like to do is load each title into a list under 1 field
> name. I then want the field to insert the list into the mail merge
> document. I want to issue a CR LF after each title. What needs to be
> a part of the text in the field supplying all of the Titles which
> causes a carriage return after each title.
>
> I can generate this text from cold fusion as I build the data, if
> only I new what the appropriate characters should be.
"Field1", "Field2", "Field3"
"Sam Jones", "Book1<CR>Book2<CR>Book3<CR>Book4", "ID"
After I do the merge I then do a find and replace, replacing all <CR> with
^p.
- David Harper