Hi,
I am trying to change the background color of some cells in a table. The table is the second table in that doc, but I fail to point to it by using index 1. I am confused about the table index. How can I decide the index of a table.
There is the code:
Document doc = new Document(iniDocStr); // iniDocStr is the place where the template locate.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToCell(1, 1, 1, 0);
builder.CellFormat.Shading.BackgroundPatternColor = rowColor;
There is the exception:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: tableIndex
at Aspose.Words.DocumentBuilder.ᐾ(Int32 ᐿ, Int32 ა)
at Aspose.Words.DocumentBuilder.MoveToCell(Int32 tableIndex, Int32 rowIndex, Int32 columnIndex, Int32 characterIndex)
at ReportWebService.shortFormGenerator.generateDocument(VLNValuation valuationSchema) in c:\inetpub\wwwroot\reportwebservice\shortformgenerator.cs:line 458
I attached the template MS Word file.
Thanks a lot.