10/24/2017 - 1:15 PM

// For complete examples and data files, please go to
String dataFilePath = CommonUtilities.wordDataFile+"/Managers Data.docx";
// Do not extract column names from the first row, so that the first row to be treated as a data row.
// Limit the largest row index, so that only the first four data rows to be loaded.
DocumentTableOptions options = new DocumentTableOptions();
// Use data of the _second_ table in the document.
DocumentTable table = new DocumentTable(dataFilePath, 1, options);
// Check column count and names.
assert table.getColumns().getCount() == 2;
// NOTE: Default column names are used, because we do not extract the names from the first row.
assert table.getColumns().get(0).getName().equals("Column1");
assert table.getColumns().get(1).getName().equals("Column2");
 return table;