What you are looking for is usually called conditional text, i.e. part of the document is displayed depending on a condition. This requires to mark up your text.
First, at the beginning of your document, define a variable which will tell when the controlled text is hidden.
- go to the
- in Type click on Set variable, type public in Name and 0 in Value
With public set to 0, all the document is visible. When it is set to 1, only non-confidential content is shown.
Now, you’re ready to mark up your document.
At the beginning of restricted paragraphs:
- go to the
- in Type click on Hidden Paragraph, in Condition enter public
This keeps all styling possibilities unchanged for the paragraph and does not require a specific style.
Hiding individual words is also possible but not very flexible (all words in a “sequence” must have the same character style). Proceed as above but select Hidden text and enter the word in Hidden text instead of inside the paragraph.
I highly recommend you enable
Formatting Marks and
Field Shading so that you have visual cues about the existence and location of the various fields.
To change the display condition, double-click on the public definition and change its value.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.