View Single Post
  #3   Report Post  
Not Really Me
 
Posts: n/a
Default Conditional hidden text?


"Jay Freedman" wrote in message
...
On Thu, 20 Oct 2005 16:59:35 -0600, "Not Really Me"
wrote:

Is it possible to have conditional control on text to determine whether or
not it is visible?

I am trying to produce a single document that would display/print in
various
versions based on a setting such as a docproperty field.


You can create a nested field (that is, fields inside a field) to do
this. The outermost field is an IF field, whose condition compares the
value of a DocProperty field to some fixed value. The "display on
true" part of the IF field can be an IncludeText field, an AutoText
field, an IncludePicture field, etc. The "display on false" part can
be empty (display nothing) or another field.

As an example, assume you define a custom document property named
Role, which you'll assign one of the values "Instructor" or "Student".
Assume also that you have two AutoText entries in the template, named
InsPage and StdPage, with alternative sections of text. The body of
the document can then contain this field (the field braces are
inserted in pairs by pressing Ctrl+F9):

{IF {DocProperty Role} = "Instructor" {AutoText InsPage} {AutoText
StdPage}}

When the docproperty is assigned the value "Instructor" and the field
is updated, the InsPage text will display. When the docproperty is
assigned any other value and the field is updated, the StdPage text
will display.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


Thanks Jay. That sounds like it should do just what I want.

Scott