Well, if the script is going to go through all the table contents, it is the right approach.
The step that is missing is the inner loop, going through the paragraphs in each cell:
doc = app.ActiveDoc;
table = doc.FirstTblInDoc ;
row = table.FirstRowInTbl;
while(table.ObjectValid()){
while (row.ObjectValid()) { //traverse rows
cell = row.FirstCellInRow;
while (cell.ObjectValid()) { //traverse cells in row
pgf = cell.FirstPgf;
while( pgf.ObjectValid()) {
// this is where you can put code to get text, or text properties from the paragraph.
}
pgf = pgf.NextPgInFlow;
}
cell = cell.NextCellInRow;
}
row = row.NextRowInTbl;
}
table =table.NextTblInDoc;
}