DocX
DocX copied to clipboard
Inserting new table rows does not update paragraphs if document is loaded
Hi!
Following error: If you load a Document and insert rows in a table, the paragraph count isn't updating. Instead you have to load the document anew.
I've provided an example code that demonstrates the issue below.
using (DocX document = DocX.Create(copyPath))
{
document.InsertTable(3, 3);
Console.WriteLine("Paragraphs after table creation and doc creation: " + document.Paragraphs.Count);
document.Save();
}
using (DocX document = DocX.Load(copyPath))
{
foreach (var table in document.Tables)
{
Row row = table.Rows[0];
table.InsertRow(row);
}
document.Save();
Console.WriteLine("Paragraphs after row insertion and doc loading: " + document.Paragraphs.Count);
}
using (DocX document = DocX.Load(copyPath))
{
Console.WriteLine("Paragraphs after doc loading no row insertion: " + document.Paragraphs.Count);
}
I've attached a screenshot for a visual aid of what I meant:

Hi, Thank you for bringing this to our attention. It will be fixed in v2.4. Have a nice day.