I have tried the INSERT, FIELD and {REF docLastFirstMiddle} which did not work.
I also tried the INSERT, REFERENCE and {{REF docLastFirstMiddle \h} which
also did not work. Is there some sort of update code that I have to run?
Update: The REF works fine but the only way to view it on the fly was to
create two lines of code which run after the prompt box is closed. This acts
like a document refresh which then allows the user to see that the data was
actuall filled in the header and footer:
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
If there is another "refresh" or "requery" type command, can someone please
let me know. Thanks, Brendan
> I have tried the INSERT, FIELD and {REF docLastFirstMiddle} which did not work.
> I also tried the INSERT, REFERENCE and {{REF docLastFirstMiddle \h} which
> also did not work. Is there some sort of update code that I have to run?
Jonathan West - 08 Aug 2006 23:27 GMT
> Update: The REF works fine but the only way to view it on the fly was to
> create two lines of code which run after the prompt box is closed. This
[quoted text clipped - 9 lines]
> please
> let me know. Thanks, Brendan
Something like this should work
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update
If the first section is protected, you may need to Unprotect the document,
run that line, and then Protect it again.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Brendan - 08 Aug 2006 23:59 GMT
Works Perfect! Thank You very much.
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update