Field Code: User entered data updates in header/footer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a template/document that has
Document Name: < Project Name >
displayed by default where < Project Name > is a field code that can
the be updated by right clicking the mouse.

Upon doing so, it would prompt the user to enter the name of the project
and then say
Document Name: My Wonderful Project

I want to have My Wonderful Project bookmarked so as to include it in the
header/footer.

This was my last attempt

{ COMMENTS "< Project Name >" { { SET ProjectName { FILLIN "Input Project
Name" \d "< Project Name >" }}}

Any help would be appreciated

Dave
 
Possibly the easiest method (instead of a bookmark) would be to apply a
character style to the <Project Name> field code and use a StyleRef field in
the header/footer. Alternatively, you could use a UserForm to collect the
name and write it to a custom document property and use a DocProperty field
in the header/footer. The advantage of StyleRef is that it updates
automatically and instantly, whereas fields can be balky about updating
(though fields in the header/footer are always updated at print time or on
Print Preview).

--
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.
 
I tried your suggestion on using the style ref method.
It isn't working.

The problem is that the header/footer is on the second page and the style is
defined on the first and I have the headers/footers turned off for the first
page.

If I add the styleref to the first page in the "First Page Footer" section,
then it
works fine, but this is not the behavior I want. I want the header/footer
to show
the title on every page except the first.

Any thoughts?

Dave
 
Assuming that you've applied a style which isn't used for anything
else to text in the main body of the document (say on the title page),
the STYLEREF field should correctly reference the text even if the
field is in the main header.

--
Stefan Blom
Microsoft Word MVP


in message
 
I agree with Stefan. This should be working provided you've used the default
(backward-looking) StyleRef field. I suspect that what has happened is that
you have inserted a page break after your title paragraph (the one you're
referencing) and then pressed Enter again to get a "blank line" at the top
of the next page. This creates an empty paragraph in the Title style, and
that's what your StyleRef field is picking up. Instead of using an empty
paragraph, add some Space Before to the first paragraph on the page; because
it follows a page break, it will be retained.

If this analysis is way off the mark, perhaps you'd like to send me a sample
document to look at.

--
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.
 
I went into the header/footer and toggled the field code and then right
clicked and
went to "Edit Field...". Upon looking at the "Field properties" list box,
I noticed that
there is a "Project Name" and "Project Name Char" style listed.

If I changed my field code to be {STYLEREF "Project Name Char" } then it
works just fine. After playing around a bit, I can get the "<xxx> Char" to
show up if I select the text and in the "Styles and Formatting" toolbar
select the style and right click and select "Update to match selection".

Now, if I delete the original style, the one with "Char" tacked on the end
is left hanging around.

I guess I have my answer, so thanks for your help.
If you have any thoughts on my confusion about the "Char" above, I am always
will willing to learn.

Cheers,
Dave
 
This isn't a real style, I think. It is something Word uses to tag your use
of direct formatting so that you can use some of the style-handling tools on
it. I think you are better off actually creating a custom character style.
Suzanne has written an excellent tutorial on this.
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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

Back
Top