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.
-
Insert
>Field
>More Fields
- go to the
Variables
tab
- in Type click on Set variable, type public in Name and 0 in Value
- push
Insert
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:
-
Insert
>Field
>More Fields
- go to the
Functions
tab
- in Type click on Hidden Paragraph, in Condition enter public
- push
Insert
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 View
>Formatting Marks
and View
>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.