Add a row to an MS Word table using Microsoft.Office.Interop

Viewed 15406

I have a word template with a table that I am populating from a list of strings that I split using tab characters.

I do not know how many lines of text I will have as it will vary.

So I am adding a row programmatically before iterating through my loop like this:

 oWordDoc.Tables[2].Rows.Add(oWordDoc.Tables[2].Rows[1]);

Unfortunately it is adding the row before rather than after the current row.

How can I change my code to always have an empty row added after the current row?

2 Answers
Related