We have a client that is unable to process Word tables correctly. To assist, we added code that is able to convert tables to text. However, when doing the conversion, we need to place the new text block exactly where the old table had been.
For example:
If the document had 3 lines like so:
Line 1
[Table consisting of 2 rows, 2 columns]
Line 3
We need to convert the Table between line 1 and line 3 so it would result in something like this:
Line 1
Line 2.1
Line 2.2
Line 3
The code we use to append the text looks like this:
// textBlock is text rendered from table
// index is where the original table was located
sec.Paragraphs[index].AppendText(textBlock);
We have been unable to find the correct index of the paragraph owner of the table. If we know the index of the owner, we could convert the table to text, insert the text at the correct location, end then delete the table.
Any help would be most appreciated.
Thank you.