How to remove date from header from word document

@alexey.noskov,

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");

11 posts were split to a new topic: How to remove an empty paragraph after table title

2 posts were split to a new topic: How to specify header distance

2 posts were split to a new topic: How to check the header border line width

4 posts were split to a new topic: How to to change the alignment of table columns content

2 posts were split to a new topic: How to to replace colon with tab key

2 posts were split to a new topic: How to check tables have borders

A post was split to a new topic: How to get tab stops