Link Merge Fields in Header and Footer


G

Guest

Hi
I've looked at all the posts on linking fields so that the information in
one displays in all, and that's great - I didn't know you could do that.
However, I need to take a date in the header of a template and display it in
the footer of the second and subsequent pages - it can't be an updating date
it has to remember the exact date. Any ideas?

Many thanks
 
Ad

Advertisements

D

Daiya Mitchell

Is the date related to the doc in any way? E.g., you could use a CreateDate
field in two places.

Is this date merged? Use the same merge field twice.

Did you try Method 3 here?
http://gregmaxey.mvps.org/Repeating_Data.htm

If none of those work, a better description of the problem is probably
necessary.
 
G

Guest

What I want to do is enter the date at the beginning of the document. This
date is repeated in the footer of section two of the document and could be
over several pages. I want the date that I type in to be automatically
updated in the footer of section 2, I don't really want to use form fields
because it is the only instance and I don't want to have to protect the
document.

I have tried using an ASK field, but I can't get it to work. I've put the
ask field in the header and referenced the field in the document and the
footer to it. I found some help on that on a search, and I copied the
AutoNew macro associated with the help into the VBA module for the document
as instructed, but it doesn't work. When I save it as a template and open a
document based on it, the ASK field doesn't activate. I'm using Word XP.
Any ideas? I'm tearing my hair out now.

Thanks
 
G

Guest

I wrote earlier saying I had used an ASK field and still hadn't had any luck.
I have now! I had put the ASK field in the header. When I moved it to the
top of the document and amended the code to look at Section 2 (the code I had
copied only looked at Section 1) it all worked. I would however, prefer to
have the ASK field in the header. The code I am using is:

Sub Autonew()
' Provoke the ASK field prompt
ActiveDocument.Fields.Update
' Update the cross-reference in the header
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary). _
Range.Fields.Update
ActiveDocument.Sections(2).Footers(wdHeaderFooterPrimary). _
Range.Fields.Update
' Place the cursor at the end of memo so far
Selection.Collapse Direction:=wdCollapseEnd
Selection.GoTo What:=wdGoToBookmark, Name:="begin"

End Sub

Do you know of any way I can amend it to allow the ASK field to be in the
header? Thanks for your help.
Jeanmac
 
D

Daiya Mitchell

I don't have a clue about ASK fields.

If you are putting the date on the first page (not the header), a StyleRef
field would carry the information and would presumably be simpler than ASK
fields.

However, I suspect with both ASK and StyleRef you run into the problem that
the header and the footer cannot talk to each other. They are both designed
to carry information from the main text, but not from each other. You might
test it with StyleRef, just in case it behaves differently. Why do you need
the date in the header, anyhow?

Where is this date coming from? What does it signify? If it matches one of
Word's predefined fields--for instance "date doc was created" "date doc was
last saved" "date doc was last printed"--using one of those will be by far
be the easiest way, and will let you put the date in the header.

Previously you said you needed the date in the footer of page 2 and forward.
Now you are saying you need it in Section 2. Which is correct? If you have
a section break between page 1 and page 2 just because you need a different
footer on page 2 than on page 1, that isn't necessary. You could use
"different first page" header/footer instead.

Does your use of "Merge" in the subject line mean this is a merge document,
or were you thinking these types of fields were called merge fields?
 
G

Guest

HI

The reason I wrote Merge fields in the header was that an ASK field is
normally a mail merge field. The reason why I have section two is not
because the document has a different first page header/footer, but because
the document has to go from one to two column text on the second page. The
ASK field allows me to manually enter the date which is then updated on the
first page of the document and in the footer of section 2, this is because
the date will be different each time and must not update.

I've got it working now, however my only question remaining was that I would
have liked to tuck the ASK field away in the header, but it's not happy with
that. If anyone has any ideas I'd be grateful.

Thank you for all your help so far.

Jeanmac
 
Ad

Advertisements

S

Suzanne S. Barnhill

Is there some reason you can't use a CreateDate field?

--
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.
 
G

Guest

I am creating a template which will be used again and again, the date will
change each time the template is used. I hadn't thought about using a
CreateDate field, of course it will change every time the template is used.
Thankyou!!!
 
D

Daiya Mitchell

I'm just curious. How did you manage to "not think about a CreateDate
field" when I suggested it twice?

I've reproduced what I said below--was there something unclear about the
phrasing that I could improve for the future? Suggestions welcome.
 
Ad

Advertisements

S

Suzanne S. Barnhill

I wondered about that, too, as I was pretty sure CreateDate had been
suggested already in this thread.

--
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.
 

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