We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add new rows to a table in word document


how can I add rows dynamically to an existing table on a word document? I will also have to add textboxes into those new rows.

see the attached the document for a table example I am talking about. how do I refer to a specific table? (my document contains lots of tables) is there a bookmark for the table??


Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think that you can clone the last row in the table. For example see the following code.

Document doc = new Document(@"Test024\table.doc");

//Get table

Table awTable = doc.FirstSection.Body.Tables[0];

//Clone last row

Row newRow = (Row)awTable.LastRow.Clone(true);

//Add cloned row to table


//Save document


Hope this helps.

Best regards.