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

Free Support Forum - aspose.com

Identify a table on word from java

I have a long document with different tables and wont to work only on one table. How can identify a table in word document using java from java.
I try with bookmarks but with old code cond work. Can help with some link or code.
Thx

@caiupi Could you please attach your document here along with code you are using to identify the table? We will check and provide you more information.
Generally, you can put bookmark inside a table and then in the code get ancestor of the bookmark of table type.

I find the code.

Bookmark bookmark = doc.getRange().getBookmarks().get("Bookmark"); 
Table table = (Table) bookmark.getBookmarkStart().getAncestor(NodeType.TABLE); 

I had problems with different versions.
thx

@caiupi Your code is correct, if the bookmark starts inside the table. Could you please attach your document here and specify which versions of Aspose.Words are you comparing? We will check the issue and provide you more information.