View Single Post
 
Old 11-01-2016, 06:11 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
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

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
[Fmr MS MVP - Word]
Reply With Quote