private static int GetChildTableCount(Table table)
{
int tableCount = 0;
// Iterate through all child rows in the table
foreach (Row row in table.Rows)
{
// Iterate through all child cells in the row
foreach (Cell Cell in row.Cells)
{
// Retrieve the collection of child tables of this cell
TableCollection childTables = Cell.Tables;
// If this cell has a table as a child then return true
if (childTables.Count > 0)
tableCount++;
}
}
// No cell contains a table
return tableCount;
}
//ExEnd