Can I hide a whole paragraph using Conditional Text Automation in Microsoft Word

5,960

It isn't obvious, but you're able to embed images and charts within the IF field in Word itself! For example:

IF "[Your Field]" = "guilty" "[text if guilty][image][chart][text]" "[text if not guilty][image][chart][text]"

That will evaluate [Your Field], and if it equals "guilty" it will display all the text, images, whatever is between the following quotes. If it doesn't equal guilty it'll show whatever text and images is between the final quotes.

Share:
5,960
jpo38
Author by

jpo38

Software developer, mainly C++, worked with MFC, now working with Qt. Using CMake and a lot Python those days...

Updated on September 18, 2022

Comments

  • jpo38
    jpo38 over 1 year

    I have a MS Word document shared between different projects. Some paragraphs only apply to some specific projects, so I'd like to hide them using custom fields.

    I found this interesting page explaing how to insert conditional text. However, this makes it possible to hide a small piece of text, in my case, it's a whole paragraph I'd like to hide, including possible tables, pictures...

    I found to way to transform

    IF "<< Matter.CustomField.Pleading >>" = "guilty" "The defendant pleads "guilty"." "The defendant pleads "not guilty"."
    

    into

    IF "<< Matter.CustomField.Pleading >>" = "guilty" 
    "The defendant pleads "guilty"."
    including images, tables
    ELSE
    "The defendant pleads "not guilty"."
    including images, tables
    ENDIF
    

    is it doable (Note that I'd like to avoid using macros, if possible)

    • cnread
      cnread over 6 years
      Would the info in this Super User question suit your needs?
    • jpo38
      jpo38 over 6 years
      @cnread: It could. Solution A won't as I need to include tables and grpahs. However, Soluiont B could. I tested and I could create tow different "Quick Parts" and then add a control that lets me switch between them. However, I was unable to successfully create a macro that would select all controls and switch to a specific version...could you post a short example/tuto to your other post?