I'm trying to get a Powershell Script working that needs to update all fields I have in Header and Footers of all pages. But even after hours of research, I don't get any farther than being able to update the fields in the main text. Sure, that is really useful and everything and I am using it as well, but I would also like to update the fields in the headers.
I'm afraid I can't be of much help other than showing you the snippet I have that updates all my fields in the document. So here goes that.
objWord = New-Object -ComObject word.application
$objWord.ActiveDocument.Fields.Update()
So, please, help.
I have been looking around since this morning and cannot find a approach that works for me. (Similar request to OP)
I have checked Adil's link however it did not update all of the document.
I needed to update external links (Objects) that I added to documents. Body, Headers and Footers need to be updated, however since many of the templates use multiple sections I was having issues.
I believe there is some waste during the Sections loop however it ensures that the entire document is updated.
Here is my solution:
The answer above didn't quite cut it for our docs, but the following did: