I’m building an application that would look for merge fields in a word document and replace them with input from the users. However I cannot seem to find how to replace the header section, on each page with users input.
it should just replace the merge fields «ClientName» & «Date» on each page with the correct information. Im using merge fields already to replace fields threw out the word document already
Example
// This code works in the body of the word document
foreach (Microsoft.Office.Interop.Word.Field field in document.Fields)
else if (field.Code.Text.Contains("Zip"))
{
field.Select();
string zip = czipcodebox.Text;
application.Selection.TypeText(zip);
}
However when ever i try to replace the the header section its skips it
Im trying to replace the header inside the document not the document name