Update fields in header/footer

Solved
iratihel Posted messages 41 Status Member -  
m@rina Posted messages 27633 Registration date   Status Moderator Last intervention   -
Hello,

I have another little question about Word 2010 that I'm struggling with:

How can I update the automatic fields in both the header and footer AT THE SAME TIME as those in the body of the text?

When I press CTRL + A, it selects everything in the body of the text, but not the content in the header/footer. So the F9 key only updates the body, and I have to go into the header and then the footer to update the others.

I know that by using the print preview, Word updates the fields if the option is checked, but I wanted to know if there’s another way to do it, or if I have to use macro/VBA?

Thank you all for your responses

Configuration: Windows XP / Internet Explorer 8.0

4 answers

  1. m@rina Posted messages 27633 Registration date   Status Moderator Last intervention   11 564
     
    Hello,

    Yes, a macro is needed...

    For the fields in the doc:
    Sub fields() For Each field In ActiveDocument.Range.Fields field.Update Next field End Sub


    For the fields in the headers and footers:
    https://faqword.com/index.php/word/faq-word/vba-solutions/548-comment-mettre-a-jour-tous-les-champs-situes-dans-tous-les-entetes-et-pieds-de-page-dun-document

    m@rina

    --
    If you want to be helped effectively, make sure you're on the right forum,... and specify the software used as well as its version. We lack clairvoyants!
    2
    1. ButteDuLac Posted messages 534 Status Member 41
       
      Just to add my two cents (almost four years later!), in case someone is looking for it... without VBA, just do a print preview, all the fields will then update...
      1
    2. m@rina Posted messages 27633 Registration date   Status Moderator Last intervention   11 564
       
      Hello,

      That's what iratihel said, but the option must be checked:

      "I know that by going through the print preview, Word updates the fields if the option is checked"
      0
  2. Golard Posted messages 25 Status Member 21
     
    Hello,

    It seems to me that there is a simpler way regarding the fields of the document (no need to loop through the fields with For Each...) :

    ActiveDocument.Fields.Update
    2
  3. iratihel Posted messages 41 Status Member 5
     
    Thank you very much m@rina!!
    0