How to read table without header footer using Aspose.Word using C#

Setp:
1.Converting word(word having header and footer) to HTML using Aspose.word (html file header and footer consider as table)
2.Converting (Converted HTML) to word using Aspose word, like (Word to HTML to Word round-trip)
3.How to read table with out header footer using Aspose.Word

Table Reading sample coding:
Aspose.Words.Document docA = new Aspose.Words.Document(“FileA.docx”);
Aspose.Words.NodeCollection tablesMani = docA.GetChildNodes(Aspose.Words.NodeType.Table, true);
var tcnt = tablesMani.Count();

Please find the attachment for your reference: Template.zip (29.4 KB)

@thiru1711

If you want to get/read the tables of document’s body only, you can use following code example. Hope this helps you.

Aspose.Words.Document docA = new Aspose.Words.Document("Template.docx");

foreach (Section section in docA.Sections)
    section.HeadersFooters.Clear();
            
Aspose.Words.NodeCollection tablesMani = docA.GetChildNodes(Aspose.Words.NodeType.Table, true);
var tcnt = tablesMani.Count();

If you want to save the document to HTML without header and footer, you can use HtmlSaveOptions.ExportHeadersFootersMode property as shown below.

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.ExportHeadersFootersMode = ExportHeadersFootersMode.None;
docA.Save(MyDir + "20.1.html", htmlSaveOptions);

If you still face problem, please share some more detail about your query. We will then answer your query according to your requirement.

Thanks @tahir.manzoor