How to remove date from header from word document ,it is reading as field start.
@srinu12 You can simply remove the appropriate field from your document. If date in your header is represented by DATE field, you can use code like this:
Document doc = new Document(@"C:\Temp\in.docx");
// Loop throug all header/footer nodes.
NodeCollection headerFooterNodes = doc.GetChildNodes(NodeType.HeaderFooter, true);
foreach (HeaderFooter hf in headerFooterNodes)
{
// Remove DATE fields.
foreach (Field f in hf.Range.Fields)
{
if (f.Type == FieldType.FieldDate)
f.Remove();
}
}
doc.Save(@"C:\Temp\out.docx");