Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2005

Tip: Looking for answers? Try searching our database.

MERGE: Can I have multiple SET statements based on one IF

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Anderson - 24 Feb 2005 01:27 GMT
Based on a field in my merge data I am trying to set multiple variables like:

If {MERGEFIELD ProgStatus} = "AD"
  then {Set Variable1 "FoundIt"}
           {Set Variable2 {MERGEFIELD AcadProgram} }
           {Set Variable3 {MERGEFIELD AdmitTerm} }
    otherwise
           {Set Variable1 "Not Found"}
           {Set Variable2 "" }
           {Set Variable3 "" }

something like that. Or must I set up 3 separate IF tests like:
{If {MERGEFIELD ProgStatus} = "AD" {Set Variable1 "FoundIt"} {Set Variable1
"Not Found"} }

{If {MERGEFIELD ProgStatus} = "AD" {Set Variable2 {MERGEFIELD AcadProgram} }
{Set Variable2 ""} }

{If {MERGEFIELD ProgStatus} = "AD" {Set Variable3 {MERGEFIELD AdmitTerm} }
{Set Variable3 ""} }

Thanks in advance for any help.
Graham Mayor - 24 Feb 2005 06:03 GMT
You can put them all in the same conditional field. Note the positions of
the quote marks.

{ IF{ Mergefield ProgStatus} = "AD" "{ Set  Variable1 "FoundIt" }{ Set
Variable2 "{ Mergefield AcadProgram }" }{ Set Variable3 "{ Mergefield
AdmitTerm }"}" "{ SET  Variable1 "Not Found" }{ Set Variable2 "" }{ Set
Variable3 "" }"}

The results are placed with REF fields.

This seems to work OK with test data using your field names.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Based on a field in my merge data I am trying to set multiple
> variables like:
[quoted text clipped - 19 lines]
>
> Thanks in advance for any help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.