How to get the current cell number or the current row number while extracting a word table using DocumentVisitor?

How to get the current cell number or the current row number while extracting a word table using DocumentVisitor in

public override VisitorAction VisitCellStart(Aspose.Words.Tables.Cell cell)

cell.??
Or

public override VisitorAction VisitRowStart(Aspose.Words.Tables.Row row)

row.??
I need to the index number of both of them.
Thanks

Hi

Thanks for your inquiry. You can use the following code to determine indexes of cells and rows.

int cellIdx = cell.ParentRow.Cells.IndexOf(cell);
int rowIdx = row.ParentTable.Rows.IndexOf(row);

Hope this helps.
Best regards.

1 Like