Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2015, 04:59 PM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default mail merge multiple rows within a grouping


I have template that I am trying to mail merge data from an excel spreadsheet. I can't seem to get directory to work. I want grouped by provider with all the members under the provider listed in the same table. I have attached the sample template and sample excel files.

If the table goes on more than one page I need the heading repeated. I want a new page everytime the provider changes.
Attached Files
File Type: xlsx sample.xlsx (282.7 KB, 82 views)
File Type: docx sample_template.docx (27.6 KB, 90 views)
Reply With Quote
  #2  
Old 11-09-2015, 07:50 PM
macropod's Avatar
macropod macropod is offline mail merge multiple rows within a grouping Windows 7 64bit mail merge multiple rows within a grouping Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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://windowssecrets.com/forums/sho...merge-Tutorial
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.

The field coding for this is 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:
https://www.msofficeforums.com/mail-...html#post23345
https://www.msofficeforums.com/mail-...html#post30327
http://windowssecrets.com/forums/sho...l=1#post928391

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 http://bit.ly/1hduSCB

In addition to a 'Many to One' merge, the latter handles:
• Merge with Charts
• Duplex Merge
• Merge with FormFields
• Merge with Attachments
• Merge to Individual Documents
• Merge, Print and Staple
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-10-2015, 06:19 AM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default mail merge multiple rows

This is not working... How can I see what the code is behind the screen of a mail merge?
Reply With Quote
  #4  
Old 11-10-2015, 12:27 PM
macropod's Avatar
macropod macropod is offline mail merge multiple rows within a grouping Windows 7 64bit mail merge multiple rows within a grouping Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What isn't working? Did you read the tutorial and look at the examples I referred to?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-10-2015, 12:36 PM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default

Yes, I finally got it to work.. Now having issues with getting total $$ on the the document.
Reply With Quote
  #6  
Old 11-10-2015, 01:40 PM
macropod's Avatar
macropod macropod is offline mail merge multiple rows within a grouping Windows 7 64bit mail merge multiple rows within a grouping Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The tutorial has examples for tallying amounts per group and the example in https://www.msofficeforums.com/mail-...html#post30327 demonstrates this.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 11-10-2015, 07:30 PM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default formatting multiple rows

I got the totals to work.. now I am having issues with formatting. The format works is the grouping only has one row.. If there are multiple rows the actual code (
DOCVARIABLE tot_amt\#"$,0"
is what shows on the merge document
Reply With Quote
  #8  
Old 11-11-2015, 01:28 AM
macropod's Avatar
macropod macropod is offline mail merge multiple rows within a grouping Windows 7 64bit mail merge multiple rows within a grouping Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since neither the tutorial nor the examples give use DOCVARIABLE fields, I can't see what that has to do with the merge under discussion.

That said, your 'DOCVARIABLE tot_amt\#"$,0"' display evidences the lack of the field braces required for a DOCVARIABLE field.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 11-11-2015, 04:48 AM
gmayor's Avatar
gmayor gmayor is offline mail merge multiple rows within a grouping Windows 7 64bit mail merge multiple rows within a grouping Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

My Many to One mail merge add-in uses docvariables (as does that of Doug Robbins). If using my add-in, you cannot use switches on the child fields. These are purely place markers and switches screw up the results. This is explained, with workarounds, on the web page http://www.gmayor.com/ManyToOne.htm .
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #10  
Old 11-11-2015, 06:00 AM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default mail merge formating

that is what the your addin process converts the mergefeild to when creating the word document. the actual code on the document is mergefield tot_amt\#"$0" the format and $$ amount shows up ok on the single row groupings but the the convert 'DOCVARIABLE tot_amt\#"$,0" shows up on the first row of the multiple row groupings.
Reply With Quote
  #11  
Old 11-11-2015, 06:03 AM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default

I do have an open and closed bracket around the whole statement... for some reason couldn't get them to copy to the forum message.
Reply With Quote
  #12  
Old 11-12-2015, 06:02 AM
tracygleghorn tracygleghorn is offline mail merge multiple rows within a grouping Windows 10 mail merge multiple rows within a grouping Office 2010 64bit
Novice
mail merge multiple rows within a grouping
 
Join Date: Nov 2015
Posts: 8
tracygleghorn is on a distinguished road
Default Mail merge many to one formatting

It is working if the grouping only has a single row child variable... Will check out the work around.

Thank you for all your help.. appreciate it
Reply With Quote
  #13  
Old 11-12-2015, 06:43 AM
gmayor's Avatar
gmayor gmayor is offline mail merge multiple rows within a grouping Windows 7 64bit mail merge multiple rows within a grouping Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by tracygleghorn View Post
that is what the your addin process converts the mergefeild to when creating the word document. the actual code on the document is mergefield tot_amt\#"$0" the format and $$ amount shows up ok on the single row groupings but the the convert 'DOCVARIABLE tot_amt\#"$,0" shows up on the first row of the multiple row groupings.
As I said, it screws up the results. Don't use switches on the child fields.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Tags
mail merge, multple rows

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula that can merge multiple rows with the same ID into one row Hilwey Excel 3 07-08-2015 08:50 PM
Mail Merge Multiple Rows Into One Document Grouped ryano Mail Merge 4 03-23-2015 04:27 PM
mail merge multiple rows within a grouping Grouping table rows to prevent individual rows from breaking across pages dennist77 Word 1 10-29-2013 11:39 PM
mail merge multiple rows within a grouping Grouping list in Mail Merge AlexTeslin Mail Merge 1 03-08-2013 09:31 PM
mail merge multiple rows within a grouping Mail Merge multiple rows? ender541 Mail Merge 1 08-21-2012 03:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft