Update fields in header/footer

Solved
iratihel Posted messages 41 Status Membre -  
m@rina Posted messages 27198 Registration date   Status Modérateur 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 réponses

m@rina Posted messages 27198 Registration date   Status Modérateur Last intervention   11 542
 
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
ButteDuLac Posted messages 534 Status Membre 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
m@rina Posted messages 27198 Registration date   Status Modérateur Last intervention   11 542
 
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
Golard Posted messages 25 Status Membre 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
argixu Posted messages 5292 Registration date   Status Contributeur Last intervention   4 842
 
0
iratihel Posted messages 41 Status Membre 5
 
Yes, indeed, it is related. I am increasingly struggling to understand what the users of my forms want....
0
iratihel Posted messages 41 Status Membre 5
 
Thank you very much m@rina!!
0