Ask and Ref Fields

G

Guest

I cannot get a REF field code in the header or footer of Word 97 to recognize the ASK field code in the main document. I have no problem with REF fields in the main document it is only in the header and footer areas.
 
C

Charles Kenyon

Could you explain the process you are following that leads you to this
conclusion?

A REF field responds to a bookmark which is created by an ASK field. REF
fields generally do not automatically update when the contents of the
bookmark change.
--

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

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
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.

bmorganh said:
I cannot get a REF field code in the header or footer of Word 97 to
recognize the ASK field code in the main document. I have no problem with
REF fields in the main document it is only in the header and footer areas.
 
G

Guest

When I set up a new template I include several bookmarks such as "Subject" of the letter. I create an ASK field at the start in which I have a prompt ask me for the subject of the letter. I then use the REF field just before the salutation of the addressee and I also would like the subject of the letter to show up in a header for each subsequent page. The problem is I cannot get the REF in the header to pick up the text from the ASK entry. There is no problem with multiple REF entries in the body of the text, it is just in the header that I have the problem.
 
G

Graham Mayor

The field is simply not updating - you can force the headers to update with
a macro eg

Sub UpdateHeaders()
Dim oField As Field
Dim oSection As Section
Dim oHeader As HeaderFooter
For Each oSection In ActiveDocument.Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
For Each oField In oHeader.Range.Fields
oField.Update
Next oField
End If
Next oHeader
Next oSection
End Sub

An alternative would be to pickup the subject line style with a STYLEREF
field

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

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
C

Charles Kenyon

Try changing to Print Preview and back. This should update the REF field in
the header.
--

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

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
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.

bmorganh said:
When I set up a new template I include several bookmarks such as "Subject"
of the letter. I create an ASK field at the start in which I have a prompt
ask me for the subject of the letter. I then use the REF field just before
the salutation of the addressee and I also would like the subject of the
letter to show up in a header for each subsequent page. The problem is I
cannot get the REF in the header to pick up the text from the ASK entry.
There is no problem with multiple REF entries in the body of the text, it is
just in the header that I have the problem.
 
G

Graham Mayor

Not really because you would need to fill the ASK field first.
Had it been my template I would have written a userform to gather the data
and you could add the code into the userform action to update the header
quite simply. In the circumstances, the styleref field may be the better
choice.

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

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
G

Guest

Let me say thank you to Mr. Kenyon and Mr. Mayor. Your assistance has been greatly appreciated. Switching to Print Preview work perfectly. I'll try to become familiar with forms as suggested by Mr. Major.
 

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