Extract Text from and Replace Text in a Table
Extract Plain Text from a Table
A Table like any other node in Aspose.Words has access to a Range object. Using this object, you can call methods over the entire table range to extract the table as plain text. The Range.getText() property is used for this purpose.
The following code example shows how to print the text range of a table.
The following code example shows how to print the text range of row and table elements.
Replace Text in a Table
Using a table’s range object you can replace text within the table. However, there are currently restrictions which prevent any replacement with special characters being made so care must be taken to ensure that the replacement string does not carry over more than one paragraph or cell. If such a replacement is made which spans across multiple nodes, such as paragraphs or cells, then an exception is thrown.
Normally the replacement of text should be done at the cell level (per cell) or at the paragraph level.
Shows how to replace all instances of a string of text in a table and cell.