Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Microsoft Office to OpenOffice Migration Guide
Previous Page Home Next Page

Conditional text

In Word the only way to have conditional text is with the “if” field2. The equivalent in Writer is the field “Conditional text”.

To insert a conditional field in Writer: Insert > Fields > Other > Functions > Conditional text or Control+F2 > Functions > Conditional text.

There is also a field “Hidden text” that hides the text when the condition is true.

Working with the relevant fields for conditional text, both in Word and in Writer, means that only small amounts of text can be conditional. However, there are times when having whole paragraphs or sections of text be conditionally hidden is very convenient. Some examples:

A test so that the same document can be used for the test itself and for the model answers.

Technical documents where the same document with variations can be used for similar models of equipment.

Writer provides a field for conditionally hiding paragraphs and the ability to conditionally hide sections. Here is an example to show how this could be done:

  1. Ensure that hidden text is viewable: Tools > Options > OpenOffice.org Writer > Formatting Aids, select both “Fields: Hidden text” and “Fields: Hidden paragraphs”.

    Note

    Conditionally hidden sections are not visible regardless of these settings if the condition for hiding them is true.

  2. At the top of the document: Insert > Fields > Other > Variables.

  3. Name: DocType. Value: Model Answers.

  4. At the start of a one paragraph answer: Insert > Fields > Other > Functions > Hidden Paragraph. For the condition type DocType == “Test” (To make this easier to insert repeatedly, create an autocorrect entry).

  5. For longer answers: Enter the model answer, select it, Insert > Section, select Hide, and enter DocType == “Test” for the condition.

  6. To print the document for a test, double-click the field at the top of the document created in steps 2 and 3, and change the value to Test. Print as usual.

Note 1

The field “Input list” has a name but this is not a variable so its value cannot be used in the condition.

Note 2

To keep adding sections, it is easier if the selection does not include the last paragraph. But if the last paragraph is selected, simply move to the end of the document (Control+End ) and then press Alt+Enter.

Microsoft Office to OpenOffice Migration Guide
Previous Page Home Next Page


 
 
  Published under the terms of the GNU General Public License Design by Interspire