public void ReplaceTextInTable()
{
//ExStart
//ExFor:Range.Replace(String, String, Boolean, Boolean)
//ExFor:Cell
//ExId:ReplaceTextTable
//ExSummary:Shows how to replace all instances of string of text in a table and cell.
Document doc = new Document(MyDir + "Table.SimpleTable.doc");
// Get the first table in the document.
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
// Replace any instances of our string in the entire table.
table.Range.Replace("Carrots", "Eggs", true, true);
// Replace any instances of our string in the last cell of the table only.
table.LastRow.LastCell.Range.Replace("50", "20", true, true);
doc.Save(MyDir + @"\Artifacts\Table.ReplaceCellText.doc");
//ExEnd
Assert.AreEqual("20", table.LastRow.LastCell.ToString(SaveFormat.Text).Trim());
}