Automated Process--VB Script Macro

G

Guest

Here's a real challenge for anyone reading this. Is it possible to write a
script in Word that will automatically perform the following action? Here's
the scenario--if the user writes "(FOUO)" in a document, can a script be
written so that Word will recognize that phrase and automatically insert a
phrase reading "For Official Use Only" in the footer (preferably in a text
box)? That's a big challenge and I don't know if it's possible. If it is,
maybe you can refer me to more information sources.

Thanx! Erik
 
S

Suzanne S. Barnhill

You can create an AutoCorrect entry that will correct FOUO to "For Official
Use Only," but if you want it in the footer, the user must first open the
footer pane before typing it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Actually, in government documents if a paragraph is marked (FOUO) it is
required that the author add "For Official Use Only" into the footer of the
same page. My question is whether an automated script can be made to do this
because it is an extremely manual and labor-intensive process. I don't want
the FOUO to be converted into "For Official Use Only." I want that phrase to
appear, automatically, in the footer if I type (FOUO) on the page. Please
advise and thanx!
 
S

Suzanne S. Barnhill

I haven't experimented with this, but here's a scenario that might (sort of)
work:

1. Define a character style called (for example) FOUO.

2. Type "FOUO," apply the FOUO character style, and save the text as an
AutoText entry.

3. When a user types "FOUO," he will get an AutoComplete tip for the
AutoText entry; pressing Enter will insert it.

4. In the header, you would use a conditional field on this order:

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

The problem would be that the StyleRef field would pick up the last use of
the FOUO style, which could be several pages back, and the result would be
that *every* page would have the statement. The workaround for that would be
to put some other text on the non-FOUO pages in FOUO style. This is not
really a viable option, however, and I suspect what you need is VBA. Since
no one has yet volunteered any in this NG, you might try posting in one of
the word.vba NGs.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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