Hi,
Please use the attached word document. Header in 1st page was removed. But unable to remove the header in 2nd page since it is created under different section. I have tried with the below code:
foreach (Section section in doc)
{
foreach(HeaderFooter hf in section.HeadersFooters)
{
hf.Remove();
}
}
Also I treid with the below code:
NodeCollection headersFooters = doc.GetChildNodes(NodeType.HeaderFooter, true);
foreach(HeaderFooter node in headersFooters)
{
if (node.HeaderFooterType == HeaderFooterType.HeaderEven ||
node.HeaderFooterType == HeaderFooterType.HeaderFirst ||
node.HeaderFooterType == HeaderFooterType.HeaderPrimary)
node.Remove();
}