Copy link to clipboard
Copied
I assume you mean that you want to apply a paragraph format to each paragraph in each cell of the table. You have to loop through all of the cells in the table and then loop through all of the paragraphs in each cell. Selecting the table is not necessary.
cell = tbl.FirstRowInTbl.FirstCellInRow;
while (cell.ObjectValid () === 1) {
if (cell.CellIsStraddled === 0) {
pgf = cell.FirstPgf;
while (pgf.ObjectValid () === 1) {
applyPgfFmt (pgf, name, doc);
pgf
...
Copy link to clipboard
Copied
I assume you mean that you want to apply a paragraph format to each paragraph in each cell of the table. You have to loop through all of the cells in the table and then loop through all of the paragraphs in each cell. Selecting the table is not necessary.
cell = tbl.FirstRowInTbl.FirstCellInRow;
while (cell.ObjectValid () === 1) {
if (cell.CellIsStraddled === 0) {
pgf = cell.FirstPgf;
while (pgf.ObjectValid () === 1) {
applyPgfFmt (pgf, name, doc);
pgf = pgf.NextPgfInFlow;
}
}
cell = cell.NextCellInTbl;
}
Copy link to clipboard
Copied
Hooray, it's working!!´:party_popper:
Cycling through the table cells makes perfect sense to me now you mention it. Thanks a lot for the quick reply!