View Single Post
  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Automatically copy form-field text to text box in header of sa

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Mercedes.K wrote:
I hate to sound like a complete moron but I'm not actually an IT
person, I just happen to enjoy computers and as we're located in a
rather remote part of the middle east, it's bloody hard to get good
help around here.
So, if either of you wouldn't mind trying again with more layman
step-by-step type instructions, it would be very greatly appreciated!
Many thanks
mercedes

"Suzanne S. Barnhill" wrote:

If the document is protected for forms, a REF field in the header
won't update without a macro, but a StyleRef field will work (see
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm). But a UserForm to
insert the required data would be better still.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

"Graham Mayor" wrote in message
...
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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Mercedes.K wrote:
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