Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

LinkBack Thread Tools Display Modes
Old 06-05-2018, 12:30 PM
thisperson1 thisperson1 is offline Windows XP Office 2000
Join Date: Jun 2018
Posts: 1
thisperson1 is on a distinguished road
Default Mail merge choosing which location

My spreadsheet columns contain contact info for various companies, and then a column each for several of our locations. So, Mr. Smith, ABC Co, 123 Street, Jonestown, CA 90210, and then HQ, Shipping, Receiving, etc. We currently have Xs in the rows noting that ABC Co relates to HQ and Receiving, while XYZ Co relates to Shipping and Software. In the mail merge Word document is there a way to (1) get it to show the location is HQ when there is just an X in the cell, and (2) do a document for ABC Co for both HQ and a separate one for Receiving?
Reply With Quote
Old 06-05-2018, 05:59 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,468
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

That's easily done via two simple IF tests. For example:
{IF{MERGEFIELD FieldName}= "X" "conditional output for X"}{IF{MERGEFIELD FieldName}= "XYZ" "conditional output for XYZ"}
{IF«FieldName»= "X" "conditional output for X"}{IF«FieldName»= "XYZ" "conditional output for XYZ"}
where 'FieldName' is the name of the field containing the X & XYZ strings. If the conditional output is to start a new page, simply insert a manual page break as the first character of the conditional output.

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. Likewise, the chevrons (i.e. '« »') are part of the actual mergefields - which you can insert from the 'Insert Merge Field' dropdown (i.e. you can't type or copy & paste them from this message, either). The spaces represented in the field constructions are all required.
Paul Edstein
[MS MVP - Word]
Reply With Quote

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing Mail Merge templates and excel Data Sources using drop downs dushan997 Mail Merge 3 08-04-2017 07:54 PM
Mail Merge to multiple employees in multiple locations as PDF by location GFiz Mail Merge 1 05-13-2017 08:01 PM
Unwanted folders when choosing form location marcoponte Outlook 1 12-16-2014 05:40 PM
Mail merge how to link mail merge field value to a column heading dsummers Mail Merge 1 05-08-2014 02:59 PM
merge to excel in dynamic location mjlaw Mail Merge 1 03-22-2012 11:16 PM

All times are GMT -7. The time now is 11:55 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc. is not affiliated with Microsoft