add text boxes to headers in a form that can be filled

S

Skada

I'm creating a word template fill-out form. There are fields in the header
that must be on all pages. How can I make these fields where I can input
data into them, without having to open the header to fill out the fields?

What I mean to say is, there are rich text boxes in the header with data
that will be on all pages, in the paragraph of the document are different
boxes that will be filled in. I don't want the end users to be forced to
open the header every time the document is opened to fill in this data. Yet,
on the developer tab, it requires that the header be open to place the text
fields in the proper places. Is there a way to place the fields in the
header portion, with out having to open the header, AND, when the end user
opens the document, they can just fill out the data on the first page and
have it print on all subsequent pages?
 
J

Jay Freedman

Skada said:
I'm creating a word template fill-out form. There are fields in the
header that must be on all pages. How can I make these fields where
I can input data into them, without having to open the header to fill
out the fields?

What I mean to say is, there are rich text boxes in the header with
data that will be on all pages, in the paragraph of the document are
different boxes that will be filled in. I don't want the end users
to be forced to open the header every time the document is opened to
fill in this data. Yet, on the developer tab, it requires that the
header be open to place the text fields in the proper places. Is
there a way to place the fields in the header portion, with out
having to open the header, AND, when the end user opens the document,
they can just fill out the data on the first page and have it print
on all subsequent pages?

No, there is no way to do exactly that. Nothing in the header can be edited
unless the header is open.

There may be other ways to achieve the same result. Try Greg Maxey's add-in
for setting up mapped content controls. You could use a single set of
controls in the body (not the header) of the first page to allow entry of
data, which would automatically propagate to the controls in the headers and
elsewhere. It looks like the add-in doesn't do rich text, but maybe that
could be worked around.

Another alternative would be a userform (custom dialog) that's displayed by
a Document_New macro when a new document is created. The data from the
userform would be written into document variables, and those values would be
displayed by DocVariable fields in the headers and elsewhere in the
document. The userform could also be redisplayed by a macro (run from a QAT
button) to change the data.

In fact, with either of these schemes, the controls in the headers are
probably unnecessary and could be removed.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
F

Fumei2 via OfficeKB.com

Uh Jay, I am uncomfortable disagreeing with you, but....

"Nothing in the header can be edited unless the header is open."

is simply not accurate.

ActiveDocument.Sections(3).Headers(wdHeaderFooterFirstPage) _
.Range.Text = "Section 3"

makes the first page header text of Section 3 be "Section 3" without opening
the header.

Any of the variety of string manipulations/editing tools can be used for the
content of any header, without opening it.

I agree with you that a userform may be a viable alternative, and that - in
fact - controls may not be needed.

RE: the OP questions about the propogation of duplicate information, there
are a number of methods. REF fields, STYLEREF fields, for example.

Jay said:
I'm creating a word template fill-out form. There are fields in the
header that must be on all pages. How can I make these fields where
[quoted text clipped - 11 lines]
they can just fill out the data on the first page and have it print
on all subsequent pages?

No, there is no way to do exactly that. Nothing in the header can be edited
unless the header is open.

There may be other ways to achieve the same result. Try Greg Maxey's add-in
for setting up mapped content controls. You could use a single set of
controls in the body (not the header) of the first page to allow entry of
data, which would automatically propagate to the controls in the headers and
elsewhere. It looks like the add-in doesn't do rich text, but maybe that
could be worked around.

Another alternative would be a userform (custom dialog) that's displayed by
a Document_New macro when a new document is created. The data from the
userform would be written into document variables, and those values would be
displayed by DocVariable fields in the headers and elsewhere in the
document. The userform could also be redisplayed by a macro (run from a QAT
button) to change the data.

In fact, with either of these schemes, the controls in the headers are
probably unnecessary and could be removed.
 
J

Jay Freedman

Disagree, please... You're correct in your context, but we're talking about
different things. The OP wanted users to be able to fill in fields in a
header in the UI without opening the header pane. You can do lots of things
with code that can't be done in the UI, and this is one of them.
Uh Jay, I am uncomfortable disagreeing with you, but....

"Nothing in the header can be edited unless the header is open."

is simply not accurate.

ActiveDocument.Sections(3).Headers(wdHeaderFooterFirstPage) _
.Range.Text = "Section 3"

makes the first page header text of Section 3 be "Section 3" without
opening the header.

Any of the variety of string manipulations/editing tools can be used
for the content of any header, without opening it.

I agree with you that a userform may be a viable alternative, and
that - in fact - controls may not be needed.

RE: the OP questions about the propogation of duplicate information,
there are a number of methods. REF fields, STYLEREF fields, for
example.

Jay said:
I'm creating a word template fill-out form. There are fields in the
header that must be on all pages. How can I make these fields where
[quoted text clipped - 11 lines]
they can just fill out the data on the first page and have it print
on all subsequent pages?

No, there is no way to do exactly that. Nothing in the header can be
edited unless the header is open.

There may be other ways to achieve the same result. Try Greg Maxey's
add-in for setting up mapped content controls. You could use a
single set of controls in the body (not the header) of the first
page to allow entry of data, which would automatically propagate to
the controls in the headers and elsewhere. It looks like the add-in
doesn't do rich text, but maybe that could be worked around.

Another alternative would be a userform (custom dialog) that's
displayed by a Document_New macro when a new document is created.
The data from the userform would be written into document variables,
and those values would be displayed by DocVariable fields in the
headers and elsewhere in the document. The userform could also be
redisplayed by a macro (run from a QAT button) to change the data.

In fact, with either of these schemes, the controls in the headers
are probably unnecessary and could be removed.
 

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