If you take a look at the javadoc for the XWPFDocument class, you should see a method called getTablesIterator() which - if you call it - will return a java.util.Iterator that allows you to step thruigh the tables in the Word document one at a time.
Assuming you are familiar with the process of using Iterators, you will get an instance of the XWPFTable class each time you call the next() method on the Iterator. With the XWPFTable instance in hand, call the getRows() method. This will return an instance of a class that implements the java.util.List class and from which you should be able to recover another Iterator object that will allow you access to the tables rows. Again, use the common idiom to get an instance of the XWPFTableRow upon which you can call the getTableCells() method. That call will return yet another List which you can step through - again most likely using an Iterator - to get access to the row's cells as instances of the XWPFTableCell class. Your Mark B -- View this message in context: http://apache-poi.1045710.n5.nabble.com/read-table-from-word-document-using-XWPF-in-Aapche-poi-tp4345743p4345899.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
