If...Then...Else statements in Word?

Options
I understand the concept of field codes and If Then Else statements in Word's mail merge.  But does anyone know if it's possible to set MULTIPLE If Then Else statements on the same field?  For example, if Fund Name=Cancer Wellness, then the sentence says something abour our Cancer Wellness program. If Fund Name=Sixty Plus, then the sentence says something about our Sixty Plus program, etc.  Or maybe if Fund Category= Community Benefit (which our Cancer Wellness and Sixty Plus programs are), then the sentence says something about the free programs our health system offers for the community, and if Fund Category=Clinical/Program, then the sentence is more clinical in nature.  I'm not sure exactly how I'd want to splice it, but my goal is to try to get away from having SO many letter templates (we have six hospitals and a LOT of funds) but still have the letter be targeted and personal enough while having Word do most of the work for me.  Curious what kinds of tricks folks might be able to offer. (Note: I am not experienced with code so prefer something that is easy to replicate.)

Comments

  • It might be possible to do all of that in Word, but it might be a little easier to manage if you use a combination of Excel and Word. I'd open the spreadsheet in Excel and add columns for whatever tags I want the letter to be based on (Cancer Wellness, Sixty Plus, etc.). Excel is much better about calculations and more user friendly when it comes to creating them. So you create your tags there and then use those additional columns as your merge fields in Word. Then the next time you export a spreadsheet, you can copy/paste it into your sheet with the added columns. As long as all the same fields are in the same columns, the formulas will still work.



    (thinking as I'm typing this) I do think you can do all of it in Word, but if you're not familiar or comfortable with code it would be like taking the training wheels off a bike and then trying to jump the Grand Canyon.
  • I've done this, but I remember it being somewhat of a pain in the neck and a lot of trial-and-error.  Even if you are working in an RE-based document, I would first set up what you want in regular old Word, and when you get it doing what you want, then go into RE setup and duplicate, using your test as a template.



    I ended up setting up our Ack Ltr process outside of RE, using MS Access.  And I love it!  Access code compiles the information as I need it, and then my Word merge documents are fairly streamlined, with only one real If-Then field.  We still have a number of letter templates, but they're in one folder on our network drive and no longer integrated inside RE.
  • It should work. Easier might be a combination of conditional merge in RE mail module (e.g. by appeal) and then do the remaining "if..when" formula in word.



     
  • Julie, we do this using nested if-then statements.  So for your example you could use something like this:



    Thank you for your gift to the [If {FundDesc} = "Cancer Wellness" then "Cancer Wellness program..." else [If {FundDesc} = "Sixty Plus" then "Sixty Plus program..." else "Piedmont Healthcare Foundation"] and on and on and on...



    That's not the exact syntax but I can follow up if you need it.  Bascially the "else" part of the statement is testing for the next fund description, and so on.
  • Julie,



    It's possible, but it would be a mess.  This is what your field would look like:



    { IF { MERGEFIELD Fund_Name } = "Cancer Wellness" "Something about our Cancer Wellness Program." "{ IF { MERGEFIELD Fund_Name } = "Sixty Plus" "Something about our Sixty Plus program" "Default message when fund name is something else." }" }



    I've seen letters go about 6 deep with multiple paragraphs per "fund name."  It's very intimidating to look at and almost impossible to troubleshoot if it gets messed up in the future.  But it's possible.  It's essentially nested "If...Then...Else" statements that can be found in the "Rules" menu within the Mailings tab (MS Word 2013). 





     
  • I might be offbase on this, but isn't this a situation where you'd create an consituent Export and for type choose Blackbaud Conditional Word Merge?



    This lets you define the different conditions (fund name = xxxx) and then you set up a different letter for each condition. Once you get them all set up, when you run the query it will look at the record and find which fund, then apply the correct letter.  So all the conditions and letters are bundled within that one conditional merge export.



     
  • I use the RE Mail --> Acknowledgement Letters and set up the Word Wizard with mulitple letters, one for each type of giving/fund and it's corresponding language.

    So in one Ack Letter set up I have approximately 25+ letters, for each fund and/or fund and how it was paid, check, credit card, stock etc.  Because I have done the If Then Else, but if there are too many, Jennifer is right, it is clunky and a pain and a lot of trial and error. 

    Having a separate letter set up for each is easy also because if there is any update to the language it is much easier to edit through the Wizard than if you have just one letter and have to edit one If Then Else. out of many -- there always seems to be some hiccup and you lose part of your template and have to rebuild.  At least that has been my experience.

Categories