P
PromisedOyster
We are using Word Automation within a C#/WinFroms application.
One of the things that this program does is set the alignment of all
columns in a table.
The code snippet is as follows.
for (int column = 1; column < columns + 1; column++)
{
Word.WdParagraphAlignment alignment =
(Word.WdParagraphAlignment)alignments[column-1];
for (int row = fieldRow; row < table.Rows.Count + 1; row++)
{
table.Cell(row, column).Range.ParagraphFormat.Alignment =
alignment;
}
}
This works very well. However, if there are a large number of rows in
the table, eg > 500 then setting the alignment does not work for all
rows. It appears to do so many and then stop. The number of rows it
processes can vary from one time to another.
Any ideas on how to workaround this issue?
One of the things that this program does is set the alignment of all
columns in a table.
The code snippet is as follows.
for (int column = 1; column < columns + 1; column++)
{
Word.WdParagraphAlignment alignment =
(Word.WdParagraphAlignment)alignments[column-1];
for (int row = fieldRow; row < table.Rows.Count + 1; row++)
{
table.Cell(row, column).Range.ParagraphFormat.Alignment =
alignment;
}
}
This works very well. However, if there are a large number of rows in
the table, eg > 500 then setting the alignment does not work for all
rows. It appears to do so many and then stop. The number of rows it
processes can vary from one time to another.
Any ideas on how to workaround this issue?