Create ROW for Existing table in Word 2007

Oct 29, 2011 at 12:55 PM


I have two questions here.

a) I have a table in the word document. Say a table with 3 Columns and 2 Rows. First row shows the HEADING and the second row contains related data. When the user clicks on a button in the aspx page, I need to append few more rows to this table and save the document.

for Example :






b) I lost all the formatting when I do any change in the document.

Any ideas or sample piece of code is appreciated, since im new here.



Oct 29, 2011 at 5:07 PM


I think that this is perhaps an issue of learning how to write programs that write Open XML markup.

The following MSDN article contains some example code to create a word table.  It may serve as a good start for your code to create a WordprocessingML table.  Go through the code, and make sure that you understand the specific sections of code that write table markup.

Document Assembly: Merging Excel, PowerPoint, and Word Content Together

Another resource that may help you is the following blog post that compares the WordprocessingML table markup to HTML table markup:

Comparison of Html/CSS Tables to WordprocessingML Tables


Oct 31, 2011 at 6:21 AM

Thanks Eric.