If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Carriage Return in Word for a Mail Merge Field
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. |
#2
|
|||
|
|||
Carriage Return in Word for a Mail Merge Field
If I have understood correctly, you are going to end up with a record for
each student, some of which will have a number of empty title fields and you don't want to end up with a load of blank lines in the merge? 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. |
#3
|
|||
|
|||
Carriage Return in Word for a Mail Merge Field
Thank you for your response - however, I think you misunderstood - I would like to have all of the titles inserted as a single merge field, not as individual fields. This would let me create a single template which would always work, regardless of the number of titles. I need to include the appropriate characters between the titles in my text file so that a carriage return is generated in the word document between each title. I just don't know what that text is that Word would intewrpret and then generate the carriage return.
"Graham Mayor" wrote: If I have understood correctly, you are going to end up with a record for each student, some of which will have a number of empty title fields and you don't want to end up with a load of blank lines in the merge? 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. |
#4
|
|||
|
|||
Carriage Return in Word for a Mail Merge Field
I don't believe this is possible, though the method I suggested could be a
workaround. Alternatively you could insert some unique temporary string eg @@@@ then merge to a new document and replace @@@@ with ^p. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org BuzzMaster wrote: Thank you for your response - however, I think you misunderstood - I would like to have all of the titles inserted as a single merge field, not as individual fields. This would let me create a single template which would always work, regardless of the number of titles. I need to include the appropriate characters between the titles in my text file so that a carriage return is generated in the word document between each title. I just don't know what that text is that Word would intewrpret and then generate the carriage return. "Graham Mayor" wrote: If I have understood correctly, you are going to end up with a record for each student, some of which will have a number of empty title fields and you don't want to end up with a load of blank lines in the merge? 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. |
#5
|
|||
|
|||
Carriage Return in Word for a Mail Merge Field
This is similar to what I do in an application where I use OLE Automation to
control the Mail-Merge process. One field may have many "Lines". In the Data Source they look like this: "Field1", "Field2", "Field3" "Sam Jones", "Book1CRBook2CRBook3CRBook4", "ID" After I do the merge I then do a find and replace, replacing all CR with ^p. - David Harper |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Excel merge to Word Footer displays merge field | Justine | Mailmerge | 7 | June 23rd, 2004 10:44 AM |
Zeros in empty mail merge field instead of just closing up | P. J. | Mailmerge | 2 | May 28th, 2004 04:27 PM |
word error | mac | General Discussions | 1 | May 6th, 2004 08:14 AM |
mail merge w/ word and excel | jmorris | Mailmerge | 3 | May 5th, 2004 03:36 PM |
Word 2003 is adding duplicate records to my mail merge | Doug Robbins - Word MVP | Mailmerge | 0 | April 24th, 2004 03:58 AM |