Search code examples
c#ms-wordheaderfooteroffice-interop

How to update fields in headers and footers, not just main document?


in C#, using wordDocument.Fields.Update() works great on everything in the main body.

Any suggestion for concise and elegant way to update the fields in the headers and footers as well?


Solution

  • Well, used this: http://blog.vanmeeuwen-online.nl/2009/09/update-all-fields-in-word-including.html, adapting to C#, just left out the condition If aField.Type = Word.WdFieldType.wdFieldDocProperty.

    Worked great.