Recently, when we upgraded from Word 2003 to 2016, We encountered a very crazy problem. When I inserted cells in any a middle row of the table, its boundaries automatically aligned with the cells corresponding to the next row, even if I set the width of the new cell base on the property “PreferredWidth” as bellow .
nc.CellFormat.PreferredWidth = PreferredWidth.FromPoints(50 );
But it word at Word 2003, the attachment is the result of using Aspose. Word to process two versions of the document. Actually, That extension of document is ‘.doc’ is the result what we wanted .
We purchased the aspose.total license end of 2018.11 and use aspose.word which version is 17.9 . in our system .word.zip (16.9 KB)
Aspose.Words.Document doc = new Aspose.Words.Document(@"C:\Users\Administrator\Desktop\UPF AATCC 183-2004.docx", new Aspose.Words.LoadOptions() { LoadFormat = LoadFormat.Docx});
DocumentBuilder db = new DocumentBuilder(doc);
Cell nc = new Cell(doc);
nc.CellFormat.PreferredWidth = PreferredWidth.FromPoints(50 );
Paragraph pg = new Paragraph(doc );
pg.Runs.Add(new Run(doc) { Text = "New Cell"});
nc.AppendChild(pg);
Table tb = doc.Sections[0].Body.Tables[0];
tb.Rows[2].Cells.Insert(2, nc);
doc.Save(@"C:\Users\Administrator\Desktop\UPF AATCC 183-2004-1.docx", SaveFormat.Docx);