Hi there,
I have a document template that I’m updating with Aspose.Words. for .NET. The template contains 20 tables of KPI / dashboard data. I update each table in the document with the following code snipet example:
t = 0;
lastCol = 8;
rowDescription = "Total AOT";
Table table = doc.FirstSection.Body.Tables[t];
if(item.GetValue("RowDescription").ToString() == rowDescription)
{
r = 2;
c = 1;
while (c<=lastCol)
{
colName = "Col" + c.ToString();
cellValue = item.GetValue(colName).ToString();
table.Rows[r].Cells[c].FirstParagraph.AppendChild(new Run(doc,cellValue));
c += 1;
}
}
this approach works fine for updating each table in the document body.
Can you please provide an example of how to refer to the first row, second cell of the only table in the document header.
I guess it’s this line that needs the correct syntax when referring to a table in the header:
Table table = doc.FirstSection.Body.Tables[t];