Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2019, 04:27 AM
B-Man B-Man is offline Mail Merge does not split tables if entry has a number in front Windows 7 64bit Mail Merge does not split tables if entry has a number in front Office 2013
Novice
Mail Merge does not split tables if entry has a number in front
 
Join Date: May 2019
Posts: 5
B-Man is on a distinguished road
Default Mail Merge does not split tables if entry has a number in front

i don't really know how to use mail merge my partner set it up and for the most part it works great.


i have an excel macro that opens word and runs a mail merge


it grabs data from the excel sheet. places the data in a word document, runs a table joiner macro (as there are space between each heading and name) and everything is how i want.... except my merge field "entry" has two headings that start with some numbers

ie.
123 Apple
123 Banana

and no matter what i do it combines them under the same group how do i get this to keep them separated like all the other mail merge data

mail merge code attached as when i copy and paste it shows the data not the code


https://www.dropbox.com/s/085ubqaoyvj4cj9/MailMerge.PNG
Reply With Quote
  #2  
Old 05-16-2019, 03:05 PM
macropod's Avatar
macropod macropod is offline Mail Merge does not split tables if entry has a number in front Windows 7 64bit Mail Merge does not split tables if entry has a number in front 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

It seems you want the table to change when the Kart changes. In that case you need to use the Kart field as a key - possible as the second in a pair of keys.

To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial in the 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...-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:
https://www.msofficeforums.com/mail-...html#post23345
https://www.msofficeforums.com/mail-...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:
https://www.msofficeforums.com/mail-...-multiple.html
https://www.excelforum.com/excel-gen...ml#post5110813

The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: https://www.msofficeforums.com/mail-...html#post67097

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
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-18-2019, 07:07 AM
B-Man B-Man is offline Mail Merge does not split tables if entry has a number in front Windows 7 64bit Mail Merge does not split tables if entry has a number in front Office 2013
Novice
Mail Merge does not split tables if entry has a number in front
 
Join Date: May 2019
Posts: 5
B-Man is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
It seems you want the table to change when the Kart changes. In that case you need to use the Kart field as a key - possible as the second in a pair of keys.

To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial in the 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...-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.
Sorry I didn't have time to do an actual mail merge before to show what it does vs what it should. But have now (linked below) Its the entry field that changes not the kart.

Quote:
Originally Posted by macropod View Post
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:
https://www.msofficeforums.com/mail-...html#post23345
https://www.msofficeforums.com/mail-...html#post30327
I will check these out and see if it's of any benefit.

Quote:
Originally Posted by macropod View Post
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:
https://www.msofficeforums.com/mail-...-multiple.html
https://www.excelforum.com/excel-gen...ml#post5110813

The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: https://www.msofficeforums.com/mail-...html#post67097

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

Heres what it does vs what it should
https://www.dropbox.com/s/pf71npyosv...erge2.PNG?dl=0


The macro and Mail Merge are fine i think its a bug in the way it handles numbers not letters or im missing something simple.

Other classes have duplicate front letters and work fine ie.
'KT Light', 'KT Medium', 'KT Heavy', 'KT Twin'. also other classes with numbers '100' and '200' work fine
but '125 Light' and '125 Heavy' seem to merge.
If i change it to '125 Light' and '126 Heavy' it works as it should. but alas they are both a '125' class

its taking the numbers as the field calling it a duplicate so not separating them and ignoring the letters behind it. So testing any class by putting 125 in front ends up merging them into the 1 table.
Reply With Quote
  #4  
Old 05-18-2019, 03:22 PM
macropod's Avatar
macropod macropod is offline Mail Merge does not split tables if entry has a number in front Windows 7 64bit Mail Merge does not split tables if entry has a number in front 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

Presumably, with the ones that do work, the numbers are different, too. Since the 125 class has two groups, you need a merge that accommodates two keys. That is what the tutorial shows how to implement.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-19-2019, 06:05 AM
B-Man B-Man is offline Mail Merge does not split tables if entry has a number in front Windows 7 64bit Mail Merge does not split tables if entry has a number in front Office 2013
Novice
Mail Merge does not split tables if entry has a number in front
 
Join Date: May 2019
Posts: 5
B-Man is on a distinguished road
Default

I'm unsure how to implement the two key as '125 Light' and '125 Heavy' are one word / one cell its not two separate cells that i combine.
Reply With Quote
  #6  
Old 05-19-2019, 07:25 AM
B-Man B-Man is offline Mail Merge does not split tables if entry has a number in front Windows 7 64bit Mail Merge does not split tables if entry has a number in front Office 2013
Novice
Mail Merge does not split tables if entry has a number in front
 
Join Date: May 2019
Posts: 5
B-Man is on a distinguished road
Default

so it was a simple fix just took some time to get my head around the code and work out what i needed to search for and as soon as i saw a solution i knew it was going to fix it.
i had already tried putting quotation marks in but they were inside the {} not outside.

Solution attached
https://www.dropbox.com/s/uvphylqtog...lMergeFix.PNG?

I had one side effect but that was solved by running my table joiner macro twice.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge does not split tables if entry has a number in front Mail Merge - split merged documents and rename each split document based on text in header FuriousD Word VBA 1 05-12-2019 04:06 AM
Can I split the color of text in front of a shape? lisach Publisher 0 12-16-2018 09:08 AM
Mail Merge does not split tables if entry has a number in front Split each page of mail merge into separate pdf Declan Mail Merge 1 05-28-2014 02:02 AM
Mail merge that identifies an autocorrect entry redzan Mail Merge 9 05-22-2014 05:23 PM
Mail Merge does not split tables if entry has a number in front Automatically split Mail Merge based on number of pages SaneMan Mail Merge 1 12-03-2011 01:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 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