Reputation: 14583
I have downloaded and started using the DocX library. I have a document called template.docx
that is being loaded into memory. I have a table in that document, that has the id = 241
. I want to get that table by its id and add rows to it. How can I do this? Here is my code:
using (DocX document = DocX.Load("template.docx"))
{
int tableId = 241, i = 0;
Table t = //here I need to find the table
foreach(DataGridViewRow row in produseFacturate.Rows)
{
i++;
//here I want to add rows to the table
}
}
Upvotes: 4
Views: 2952
Reputation: 14583
I found a solution myself.
Since, document.Tables
is a list, I can call it like this:
Table t = document.Tables[3]; // I found out that the table index is actually 3;
Upvotes: 2