Automatically copy form-field text to text box in header of same d

M

Mercedes.K

I am trying to create a multi-page instruction document for clients. For
each new client, one of our staff members will have to tailor the document to
that client by entering the client's details only. All other content will
remain the same.
There is a form field on the cover page showing staff where to enter client
name, client company name etc...
As part of the design of the document, there is an autoshape rectangle (1 in
wide by 10 inches high) running vertically down the right side of the page
and placed in the header (to be seen on each page). I would like the
client's details that are entered into the form field to automatically show
in the text box. I do not want staff to have to go into the header to
re-enter the info in the autoshape as the document will be protected.
So is there ary way to enter a formula or create a link or something to do
this automatically??
Many, many thanks!
mercedes
 
G

Graham Mayor

This is easier said than done.

1. If you have a ref field in the header, then you will need an update macro
run on exit from the associated form field. The sample update code at
http://www.gmayor.com/installing_macro.htm will suffice.

2. Text boxes are in the graphics layer and thus cannot be used with ref
fields.

3. You can use a frame rather than a text box in the header, and this will
effectively do the same job as a text box, but is in the text layer and so
the REF field will work.

4. If you don't want to use macro with the document, then you will have to
format the field in question with a unique paragraph style and use a
Styleref field in the frame to reproduce the content of that style i.e. the
field (you can use a character style with the same format as the surrounding
text. Only the style name matters)


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

Mercedes.K

Strike that last bit. I figured it out. Thanks very much to both.
Suzanne, your advice on the link you sent couldn't have been more perfect.
 
G

Graham Mayor

If you double click a form field while the form is unlocked, you will access
its properties. One of those properties is the bookmark name. By default the
first such field will be bookmarked "Text1" with each extra field
incremented by 1. That bookmark name can be changed to any other name of
your choice. Let's assume that it is "Text1" .

You can reproduce the content of a form field by using its bookmark name in
a cross reference {REF} field. Thus for Text1 {REF Text1} or simply {Text1}
would reproduce the content of the bookmarked field. (Note the brackets { }
are placed with CTRL+F9). Check the calculate on exit text box of the form
field's properties.

The snags as far as you are concerned are twofold.

1. REF fields in text boxes or graphical shapes don't work as they are in
the drawing rather than the text layer of the document.
2. REF fields in a header will not update automatically.

You have both issues.

The text box issue is resolved by replacing the rectangular text box with a
frame. A frame has some of the properties of a text box but it is in the
text later rather than the drawing layer.

You can insert the REF field in the frame placed in the document
header/footer, but it will not update. In order to update a REF field in the
header/footer you must run an update macro on exit from the form field (form
field properties again). You can copy the update macro from
http://www.gmayor.com/installing_macro.htm which also explains how to
install it.

Alternatively you can create a new, uniquely named, character style based on
the formatting of the form field. The only difference between the underlying
style and the new character style would be the different names by which they
are called from the styles dialog. Apply the character style to your form
field.

Then in the frame insert a Styleref field to call this new character style
name.

Styleref fields update automatically according to the content formatted in
the style.

Does that help?

You'll find much of this illustrated at
http://gregmaxey.mvps.org/Repeating_Data.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

All of which overlooks the fact that the document is protected, so a REF
field in the header *will not work* (at least not without a macro), which is
why a StyleRef field is required. I think that my article at
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm makes it pretty clear how to
create the character style and insert the StyleRef field.
 

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