Get all tables from document

Hi all,

how is it possible to get all tables from a doc ?

I have a requirement specification document which contains tables with requirements and their IDs. I want to get all IDs’ texts and requirements’ texts to feed a sheet.


Hi @PhaustSceptic

Could you please provide us with details of desired scenario?
I can’t immediately figure out the necessary methods

Thanks Nikolas,

I have document (word type).
In this document I have tables.
Some of these tables (req tables) have two columns (ID, Requirement).

I want to find all req tables and extract all ID/Requirement data couples in order to add them in an spreadsheet.

Hope this will help you.

Hi @PhaustSceptic
You can use the following scenario:

  1. Get all the sheets in table. GetSheets
  2. Iteratively go through the array and select the req tables
  3. Depending on the structure of the sheet, use find method to find the desired column
  4. Get data iterating by column
  5. Write to result sheet.

Thanks Nikolas,

but I think I have not been clear.

All my requirements are in a “word” document into “word” type tables.

From an “excel” document, I want to read the “word” one, iterate threw “word” table type tables and copy each requirement into the “excel” document.

I’ve found how to extract my requirements of my “word” document from the “word” document using GetAllTablesOnPage()for each pages (I use the v7.0.0).

But I write the result in the console… I would like to export this result in an “excel” type document (or import). My documents are hosted in the cloud (Nextcloud).

Hope my explanations are clearer.