We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Wrong count of tables


We received a document to process, and something weird is happening, Aspose just found one table, but the document has at least 4.

The code that I used is just this 3 lines:

Document wordDocument = new Document(“TestTableCountAspose.docx”);
NodeCollection tables = wordDocument.getChildNodes(NodeType.TABLE, true);
System.out.println("Number of tables in the document " + tables.getCount());

And the result is:
Number of tables in the document 1

It’s weird, please find attached the document for test purpose.

Any ideas of why this is happening?


Hi David,

Thanks for your inquiry. Please make sure that you’re not using Aspose.Words in evaluation mode. Please apply license before creating Document object. Hope, this helps.

Best regards,

Oh perfect… That was the problem.

Thanks again