Attn. Doug Robbins--Conditional Header/Footer

E

erik_gregory

I hope this message reaches Doug Robbins, Word MVP, but any help from anyone
else is welcome.

Some time ago I queried this NG about conditional headers/footers and the
need to have Word display "For Official Use Only" in the footer when there
was for official use only material (marked as (FOUO)) in the text.

The following is what Doug Robbins wrote, but I'm having difficulties with
this. When I follow these directions, the field in the footer simply displays
"STYLEREF". Also, when I have the AutoCorrect option enabled and type
(FOUO)--(which automatically converts the style of the target paragraph to
"Official")--Word inserts a line break, which I am hoping to eliminate.

Here is what Doug wrote and if you can answer the questions above, I'd be
grateful, REALLY grateful!

---Create a new character style. I called the one I used "Official". Now
type (FOUO) and select it and apply that style to it. Then with that
selected, from the Tools menu, select Autocorrect options and on the
AutoCorrect tab you should see (FOUO) in the "With::" section of the "Replace
as you type area". Click with the mouse on the "Formatted text" radio button
and in the "Replace:" section type fouo then click on add. Now in your
document, whenever you type fouo and press the space bar, it will be replaced
the (FOUO) formatted with the "Official" style. Now, in the footer, insert
the following field construction--{ IF {STYLEREF Official } = "(FOUO)" "FOR
OFFICIAL USE ONLY" "" }

Now on any page on which you do not want the "FOR OFFICIAL USE ONLY" to
appear, just select something and apply the Official style to it.

Hope this helps---
 
G

Greg Maxey

Erik,

I thought that we had covered this ground before. Doug's method works
in a very limited way.

I don't know why your field code is not working. Following Doug's
steps it works fine for me. The footer displays "For Official Use
Only" if the *first bit* of text found with the Official style applied
is (FOUO). However, if you format an entire paragraph with the style
and that paragraph expands across a page then "For Official Use Only"
will not appear on the subsequent page (unless of course the text
(FOUO) is the first text on the new page). It just doesn't work like I
know you want it too. In addition even if you used (FOUO) with the
Official style wiht hidden font format applied as a trailing text
marker it won't work like the method we discussed earlier. A STYLEREF
field won't pick up a reference to hidden text.

As for your field code is seems you may be constructing it incorrectly.
The construction below works as Doug explains. Remember, each pair of
field braces "{ }"must be inserted with CTRL+F9. The parens are
standard paraens. You must have a character style named Official. For
the header to display "For Official Use Only" the first text on the
page formatted with the Official style must be (FOUO).

{ IF { StyleRef Official }="(FOUO)"" For Official Use Only """ }

Sorry but you can't declare Eureka yet ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top