#  Other Applications & Softwares  > Word Formatting & General >  >  MS Word Mail Merge - insert page break after new data set begins?

## MattR

Hello, 

Any help is greatly appreciated! 

I am trying to create a mail merge that has 6 student progress reports showing on a single printed page.  Each progress report has student grade data and a teacher name on it.  I would like to have a page break inserted as the teacher names change.  This would allow me to print the file and sort by teacher name for easy distribution since the printed pages would be grouped by 'Teacher'.

I have created a sample data file and sample word file.  I have downloaded an add on called 'merge tools' and tried the 'Many to One' feature, but was unable to get it to work properly.  I am not familar with code, but I can follow simple cut and paste directions!  

Again, I greatly appreciate your time and effort in assisting me with this project I am working on.  This project, if I get it up and running, will help us track our student's progress!

----------


## macropod

See attached. The document uses a Directory merge, which only requires a single set of cells and a two-column page layout, and none of your DOCVARIABLE fields.

Note: there is an unavoidable gap around all of the grouped cells.

----------


## MattR

Thank you for your post.  However I am trying to recreat this so I have a better understanding.  However I am not sure what you mean by: "only requires a single set of cells"   

-Mail Merge - Directory 
-page setup with 2 columns & then I Created template/table
-Selected source file
-Inserted my merge fields
-Finish & Merge - 'Edit Individual Documents'

The finish product produced 6 tables on a page, looked great, however it did not page break for each new teacher.

I think I am missing something as I insert my merge fields?

----------


## macropod

The attachment, as returned, has the entire field construction you'll require. Did you examine the field coding and test the merge by re-connecting the document to your own data source & executing the merge? It is rather more complicated than simply inserting the table and mergefields.

----------


## MattR

Ok, I see.  Field Codes are new to me, and I did find more of your posts along with your reference to a merge tutorial.  I was able to add my own source data to the file you posted, but I am having trouble removing a 'cell' that my table is pasted inside?  I realize that I don't need that outter cell and I could possibly get more data tables per page without it.  When I turn on the field coding I am having trouble viewing all of the code.  It looks like some is hidden behind the table, sounds simple but I am having trouble moving the table out of the way!?  Not a major issue I was just trying to recreate the document based on what you posted and with the tutorial.  It is hard to tell where the data table fits in within the string of code.  See picture posted:


Untitled.jpg

----------


## macropod

The difficulty you'll have viewing the field code is due to its paragraph line spacing being set to 0.7pt - which is required to minimise the inter-table vertical spacing. To view the code more easily you can set the paragraph spacing back to single spacing without upsetting anything else.

----------


## MattR

Ok, thanks.  In my efforts to recreate this, I am receiving the following errors(see images attached).  I have pasted 2 pictures, one showing the code I used and the other showing the preview.  The preview looked good, but once I finished the merge I got errors.  I recreated using an outer table and then inserting my table that will contain the data.  I tried creating this without the outer table, but I could not get the proper formatting - word kept cutting the table off and wrapping it to the next page.  I figure the outer table will prevent that formatting issue.  Not sure if that is the best way to go or not?  I am trying to get 10 per page.

Again, I appreciate your time.
FieldCodes.jpgPreview.jpg

----------


## macropod

It's not really apparent from your attachments what's going on with the document. Try the attached.

----------


## MattR

*{*THAT SHOULD DO IT*}*   Thank you for your help with this.  I was using the {QUOTE 12} for page breaks, but I take it that it is easier to adjust the line spacing when using " Ctrl+Enter " (just a guess not really sure!). I adjusted the Before/After spacing to create a slightly larger gab between tables.

I have enjoyed learning about field codes, as this was completely new for me!  

Thanks again for your time!

Matt

----------


## macropod

In the latest attachment, I reduced the size of the paragraph break by using a 1pt font there, combined with a 0.2 multiple line spacing. That's a bit different to what I did with the previous version. You could adjust the inter-table spacing by changing either of those parameters.

You could indeed use {QUOTE 12} to insert page breaks, but I've used a continuous & 'next page' Section break pair so the columns will be more-or-less balanced on pages that don't get filled.

----------


## JackMock

Hi,

Can I ask for help please. I was looking for some tuitorial on how to input page break on a mail merge and I found out this thread. This is very helpful and tried to apply  it on what I am currently doing. But I encountered error while executing the given sample on my work. Could you please help on this. Thank you in advance for the help.

Output result should be:

-Every new System ID(Customer Name) should be in next page.
( I am currently doing a one pager report).

Hope you could help me on this.

Thank you very much!

----------


## macropod

You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my *Microsoft Word Catalogue/Directory Mailmerge Tutorial* at:
http://www.msofficeforums.com/mail-m...-tutorial.html 
or:
http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

Depending on what you're trying to achieve, the field coding for this can be complex. However, since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert  your own field names and adjust the formatting to get the results you desire. For some worked examples, see the attachments to the posts at:
http://www.msofficeforums.com/mail-m...html#post23345
http://www.msofficeforums.com/mail-m...html#post30327 

Another option would be to use a DATABASE field in a normal letter mailmerge main document and a macro to drive the process. An outline of this approach can be found at: http://answers.microsoft.com/en-us/o...1-1996c14dca5d
Conversely, if you're using a relational database or, Excel workbook with a separate table with just a single instance of each of the grouping criteria, a DATABASE field in a normal letter mailmerge main document could be used without the need for a macro. An outline of this approach can be found at:
https://answers.microsoft.com/en-us/...f-8642e46fa103 
For some working examples, see:
http://www.msofficeforums.com/mail-m...-multiple.html
https://www.excelforum.com/excel-gen...ml#post5110813 

Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or
Doug Robbins at https://onedrive.live.com/?cid=5AEDC...43615E886B!566

----------


## JackMock

Thanks a lot for the quick reply . Will try to do it  :Smilie:

----------


## FDibbins

> Thanks a lot for the quick reply . Will try to do it



*Administrative Note:*

Welcome to the forum.  :Smilie: 

For future reference, we are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

Please see Forum Rule #4 about hijacking and start a new thread for your query.

If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

----------

