Hi,
Is there any way to get the merge field that is in the Header and Footer of the document. currently i am not able to get those, any way of doing that.
Thanks in Advance
Document document = new Document();
document.LoadFromFile(FilePath + @"22596.docx");
FieldCollection fields = document.Fields;
List<Field> fieldInHeaderFooter = new List<Field>();
foreach (Field field in fields)
{
//detect if the field is in header and footer
if (field.OwnerParagraph.Owner is HeaderFooter)
{
fieldInHeaderFooter.Add(field);
}
}