I am writing addin for a word to automate editing a protocol template.
There is a table in the template, and I want to extract / copy the generated cell text inside this table.
Now I am doing this:
Range formattedText = agendaTable.Rows[i].Cells[1].Range; string temp = formattedText.WordOpenXML;
Later I want to paste the text into another cell in the table:
otherTablesRow.Cells[1].Range.InsertXML(temp);
The formation is correct, with the exception of the line ("\ r \ a") at the end, which comes from the range in which I extract the text from the cell. The word seems to use a line to mark the end of a cell.
So, after pasting the text into the cell of other tables, I have two lines. How can I avoid duplicate rows? Does anyone know an alternative method for retrieving cell contents?
Update: Perhaps I am asking my question differently.
My common problem is to copy more than one formatted text range into memory and paste it later somewhere in the same document.
source share