Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
Old 11-01-2016, 02:04 AM   #1
Novice
 
Join Date: Dec 2015
Posts: 4
ajh19742000 is on a distinguished road
Default Using multiple IF statements on a mail merge

Hello,
I am trying to produce a letter to send out to our clients that uses an IF statement. For example if a field says Art and Design and would like the merge to enter specific text. If the same field says Performing Arts then display different text. How is this done within the document? Additionally can this be saved as a template?

Thanks
Andy
ajh19742000 is offline   Reply With Quote
Old 11-01-2016, 06:11 PM   #2
Administrator
 
macropod's Avatar
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 17,029
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 behold
Default

Quote:
Originally Posted by ajh19742000 View Post
I am trying to produce a letter to send out to our clients that uses an IF statement. For example if a field says Art and Design and would like the merge to enter specific text. If the same field says Performing Arts then display different text. How is this done within the document?
Simply create two IF tests, coded along the lines of:
{IF{MERGEFIELD Subject}= "Art and Design" "Art and Design text"}
{IF{MERGEFIELD Subject}= "Performing Arts" "Performing Arts text"}
or:

{IF«Subject»= "Art and Design" "Art and Design text"}
{IF«Subject»= "Performing Arts" "Performing Arts text"}

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, you can't type or copy & paste the chevrons (i.e. '« »') - they're part of the actual mergefields, which you can insert from the 'Insert Merge Field' dropdown. The spaces represented in the field construction are all required.
Quote:
Originally Posted by ajh19742000 View Post
Additionally can this be saved as a template?
For mailmerges, you use a mailmerge main document, not a template. Executing the merge produces whatever output (email, printout, or document) you require.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
macropod is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailmerge certain text using multiple if statements Debs Mail Merge 4 06-19-2014 03:34 AM
Multiple If statements bremen22 Excel 2 10-15-2013 06:37 AM
Multiple If statements, Jamal NUMAN Excel 12 08-07-2013 01:41 AM
showing results of If statements in a mail merge m&co Mail Merge 3 01-06-2012 07:27 PM
Multiple Mail Merge? imogul Mail Merge 1 06-24-2011 07:20 PM


All times are GMT -7. The time now is 04:29 AM.


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