Microsoft Office Forums Word 2013 mail merge directory conditional printing city if value changes

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2018, 03:22 PM
ghampton ghampton is offline Word 2013 mail merge directory conditional printing city if value changes Windows 7 64bit Word 2013 mail merge directory conditional printing city if value changes Office 2013
Novice
Word 2013 mail merge directory conditional printing city if value changes
 
Join Date: Jan 2018
Posts: 4
ghampton is on a distinguished road
Default Word 2013 mail merge directory conditional printing city if value changes

Hello All. To put it simply, I need to create a directory of our offices. I have already created a successful mail merge of the data and it looks pretty good. Now I need to fine tune it. What I want to do is to print the city to the far left if it is a different city and nothing if it is the same city.



My merge works just fine and indenting / formatting shouldn't be a problem for me, I just need to know how to print the city if different from the last one, else skip it. Here is a short example of what I am looking for. The Bold Underline field is { MERGEFIELD Address_City } and is the key field for this. The display below is sort of what the output should be, although I shortened it up for the post.

DIRECTORY

Atascosa
Company Address Atascosa, TX zip
Company 2 Address Atascosa, TX zip

San Antonio
Company 3 Address San Antonio, TX zip
Company 4 Address San Antonio, TX zip
Company 5 Address San Antonio, TX zip
Company 6 Address San Antonio, TX zip

Von Ormy
Company 7 Address Von Ormy, TX zip

Thank you in advance for your help
Reply With Quote
  #2  
Old 01-08-2018, 03:44 PM
macropod's Avatar
macropod macropod is online now Word 2013 mail merge directory conditional printing city if value changes Windows 7 64bit Word 2013 mail merge directory conditional printing city if value changes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,482
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
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.

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
http://windowssecrets.com/forums/sho...l=1#post928391

Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An example of this approach can be found at: http://answers.microsoft.com/en-us/o...1-1996c14dca5d
Conversely, if your workbook has a separate sheet 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. For an example of that, see:
https://answers.microsoft.com/en-us/...f-8642e46fa103
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 http://bit.ly/1hduSCB
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 01-08-2018, 04:36 PM
ghampton ghampton is offline Word 2013 mail merge directory conditional printing city if value changes Windows 7 64bit Word 2013 mail merge directory conditional printing city if value changes Office 2013
Novice
Word 2013 mail merge directory conditional printing city if value changes
 
Join Date: Jan 2018
Posts: 4
ghampton is on a distinguished road
Default

I guess I need to be more specific. I am only after one thing. I have this in a word booklet docx (properly formatted, of course) with a SQL Server data source, which works just fine for quite a few pages.

DIRECTORY

Company Address Atascosa, TX zip
Company 2 Address Atascosa, TX zip
Company 3 Address San Antonio, TX zip
Company 4 Address San Antonio, TX zip
Company 5 Address San Antonio, TX zip
Company 6 Address San Antonio, TX zip
.
.
.
.
.
Company 727 Address Von Ormy, TX zip

The problem is, that I need to add the city name to the left (as indicated) if it is first time for the city or is different from the previous city.

Here is what the output should look like:
Atascosa
Company Address Atascosa, TX zip
Company 2 Address Atascosa, TX zip
San Antonio
Company 3 Address San Antonio, TX zip
Company 4 Address San Antonio, TX zip
Company 5 Address San Antonio, TX zip
Company 6 Address San Antonio, TX zip
Von Ormy
.
.
.
.
.
Company 727 Address Von Ormy, TX zip

I have tried a few iterations but the merge came out incomplete or gave different results. Which is based on your tutorial. I guess the other items you have in it, along with the different naming conventions and other problems you addressed just doesn't address this simple item.

I forgot to mention that I am a programmer, asp and .net, formerly cobol, natural 2, jcl. But WordMerge (What is the language?) is a little confusing for me, primarily because I don't understand the syntax.

If you could answer my question here, it will really help with the rest of it. I just need to understand the syntax as it applies here in this part, leaving out all the rest. Just how to make the City work.

Understanding this part will go a long way to helping me with the rest of it.

Thanks for responding. I hope you will again.
Reply With Quote
  #4  
Old 01-08-2018, 04:41 PM
macropod's Avatar
macropod macropod is online now Word 2013 mail merge directory conditional printing city if value changes Windows 7 64bit Word 2013 mail merge directory conditional printing city if value changes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,482
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

The method described in the tutorial is perfectly capable of producing the output you require - there is nothing to prevent the City name appearing as both a heading and in the entries for that city (assuming your data source has a separate field for the City name). The first and second of the DATABASE field approaches can do likewise. If the address and city are in the same field, there's nothing a mailmerge can do to generate the desired output.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 01-09-2018, 07:39 AM
ghampton ghampton is offline Word 2013 mail merge directory conditional printing city if value changes Windows 7 64bit Word 2013 mail merge directory conditional printing city if value changes Office 2013
Novice
Word 2013 mail merge directory conditional printing city if value changes
 
Join Date: Jan 2018
Posts: 4
ghampton is on a distinguished road
Default

OK. I guess I will have to wade through the expansive tutorial and figure out the answer for myself. Thank you for your response.
Reply With Quote
  #6  
Old 01-11-2018, 02:15 PM
ghampton ghampton is offline Word 2013 mail merge directory conditional printing city if value changes Windows 7 64bit Word 2013 mail merge directory conditional printing city if value changes Office 2013
Novice
Word 2013 mail merge directory conditional printing city if value changes
 
Join Date: Jan 2018
Posts: 4
ghampton is on a distinguished road
Default

I have found the answer I was looking for. Short and sweet and uncluttered by other items. http://homepage.swissonline.ch/cindy...faq1.htm#DBPic

Have a good day.
Reply With Quote
Reply

Tags
directory, mail merge, word 2013

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2013 mail merge directory conditional printing city if value changes Creating a directory merge (Office 2013) blackystrat Word 1 09-10-2016 04:03 AM
Word 2013 mail merge directory conditional printing city if value changes Directory Mail Merge IslandAC Mail Merge 1 09-09-2016 04:53 PM
Word 2013 mail merge directory conditional printing city if value changes Word 2010 - directory mail merge - two separate group of data in one document htsu Mail Merge 2 03-07-2016 03:10 PM
Directory Mail Merge Issues dbpros_crm Mail Merge 10 01-20-2014 11:05 PM
Word 2013 mail merge directory conditional printing city if value changes mail merge treating CITY as DATE woody Mail Merge 6 01-30-2013 03:22 PM


All times are GMT -7. The time now is 03:11 PM.


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