Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2013, 10:37 AM
officegirl officegirl is offline Mail Merge Directory - Combining fields Windows 7 64bit Mail Merge Directory - Combining fields Office 2007
Novice
Mail Merge Directory - Combining fields
 
Join Date: Mar 2013
Posts: 2
officegirl is on a distinguished road
Default Mail Merge Directory - Combining fields

For a school directory, Iwant to print the student's name in one column and parent's names in another. Fields are Parent1 and Parent2.



I want to print both if both are populated with the word "and" between them, and only Parent1 if Parent2 is blank. In other words:

If Parent2 is blank, print Parent1 else print "Parent1 and Parent2"

Example:

Student Parent

John Smith Chris and Debbie
Tina Jones Barbara

I can't figure out how to print both parent names if they are both populated in the else clause. Just listing them {MERGEFIELD Parent1} {MERGEFIELD Parent2} does not work -- it only prints Parent1.

Can anyone give the proper syntex?
Reply With Quote
  #2  
Old 03-21-2013, 11:02 PM
macropod's Avatar
macropod macropod is offline Mail Merge Directory - Combining fields Windows 7 64bit Mail Merge Directory - Combining fields Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi Officegirl,

Basically, the field construction would be something like:
{MERGEFIELD Student _First_Name } {MERGEFIELD Student _Last_Name } {IF{MERGEFIELD Parent1_Last_Name} = {MERGEFIELD Parent2_Last_Name} "{MERGEFIELD Parent1_First_Name} & {MERGEFIELD Parent2_First_Name} {MERGEFIELD Parent1_Last_Name}" "{MERGEFIELD Parent1_First_Name} {MERGEFIELD Parent1_Last_Name}{IF{MERGEFIELD Parent1_Last_Name} <> "" " & {MERGEFIELD Parent2_First_Name} {MERGEFIELD Parent2_Last_Name}"}}
or:
«Student _First_Name» «Student _Last_Name» {IF«Parent1_Last_Name» = «Parent2_Last_Name» "«Parent1_First_Name» & «Parent2_First_Name» «Parent1_Last_Name»" "«Parent1_First_Name» «Parent1_Last_Name»{IF«Parent1_Last_Name» <> "" " & «Parent2_First_Name» « Parent2_Last_Name»"}}

Note: The field brace pairs (ie '{ }') for the above example are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar. Also, the test requires - at a minimum - that there be separate fields for the parents' last names.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
directory, ifthenelse, mail merge

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory Mail Merge with table layout 3N1GM4 Mail Merge 11 06-03-2014 09:54 PM
Mail Merge Directory - Combining fields Mail Merge only produces 15 fields fm 22 Galceran Mail Merge 2 02-10-2013 05:47 PM
Mail Merge Directory - Combining fields Detecting Page Breaks in Mail Merge Directory TimK9VB Mail Merge 6 11-20-2012 01:52 PM
Mail Merge Directory - Combining fields Conditional merge fields in mail merge Aude Mail Merge 1 01-06-2012 07:38 PM
Paragraph Breaks In Mail Merge Fields SamuelT Mail Merge 0 09-25-2008 06:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:21 PM.


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