How to replace a \"FIELD\" in the header/footer?
Ex: Word doc file with File Name & Date. in place of file path - [FilePath] instead C://Documents/Location/Filen
object replaceAll = MSWord.WdReplace.wdReplaceAll;
foreach (Microsoft.Office.Interop.Word.Section section in oDoc.Sections)
{
Microsoft.Office.Interop.Word.Range footerRange = section.Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
footerRange.Find.Text = "Some Text";
footerRange.Find.Replacement.Text = "Replace Text";
footerRange.Find.Execute(ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref replaceAll, ref missing, ref missing, ref missing, ref missing);
}
oDoc is a "MSWord.Document" object which has current doc i.e.
oDoc = oMSWord.Documents.Open(ref "DocPath", ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
Then apply loop on "Sections" of current oDoc object. Based on "Sections" you will get range of Footer. Then you will able to find and replace the text in Footer.