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?
I found it, it should be:
Object oMissing = System.Reflection.Missing.Value;
oWordDoc.Tables[2].Rows.Add(ref oMissing);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With