User-variables and the Hidden-Paragraph function.
I positioned the cursor at the start of the document and from the "Insert" menu, chose "Field", "Other". I selected the "Variables" tab then I set Type to "Set Variable", Name to "Product", Value to "Foo" and Format to "Text" (if you don't do this the variable is assigned a value of 0)
I then positioned the cursor within the first of two alternative paragraphs and from the "Insert" menu chose "Field". I selected the "Functions" tab and chose "Hidden Paragraph" and set the Condition to Product != "Foo" (meaning hide this paragraph if the Product isn't Foo)
I then positioned the cursor in the second of the alternative paragraphs and repeated the process but set the condition to Product == "Foo".
I repeated the above for all pairs of alternative paragraphs in the document.
Finally, on the document "View" menu I unticked "Hidden Paragraphs".
By clicking on the field at the start of the document I could edit it's value and thus cause alternative paragraphs to appear (and their counterpart disappear) throughout the document. Using "Export to PDF" had the desired effect of not including currently hidden paragraphs.
OpenOffice Help describes it like this:
Hiding Text
You can use fields and sections to hide or display text in your document if a condition is met.
Before you can hide text, you must first create a variable to use in the condition for hiding the text.
To Create a Variable
- Click in your document and choose Insert - Fields - Other.
- Click the Variables tab and click "Set Variable" in the Type list.
- Click "General" in the Format list.
- Type a name for the variable in the Name box, for example, Hide.
- Enter a value for the variable in the Value box, for example, Hide.
- To hide the variable in your document, select Invisible.
- Click Insert and Close.
To Hide Text
- Click in the document where you want to add the text.
- Choose Insert - Fields - Other and click the Functions tab.
- Click "Hidden Text" in the Type list.
- Enter a statement in the Condition box. For example, using the variable you previously defined, enter Hide==1.
- Type the text that you want to hide in the Hidden text box.
- Click Insert and Close.
To Hide a Paragraph
- Click in the paragraph where you want to add the text.
- Choose Insert - Fields - Other and click the Functions tab.
- Click "Hidden Paragraph" in the Type list.
- Enter a statement in the Condition box. For example, using the variable you previously defined, enter Hide==1.
Click Insert and Close.
You must enable this feature by removing the tick mark from the View - Hidden Paragraphs menu. When the tick mark is present, you cannot hide any paragraph.
To Hide a Section
- Select the text that you want to hide in your document.
- Choose Insert - Section.
- In the Hide area, select Hide, and then enter an expression in the Condition box. For example, using the variable you previously defined, enter Hide==1.
- Click Insert.