Hi Mark,
Thank you for contacting Syncfusion support.
From the given details, we have found that your requirement is to replace the text in the table cell with another text. You can achieve our requirement in two ways. There are,
1. Replacing the text using Replace API as like below.
|
document.Replace("<1>", "One", true, true); document.Replace("<2>", "Two", true, true); document.Replace("<3>", "Three", true, true); document.Replace("<4>", "Four", true, true); document.Replace("<5>", "Five", true, true); |
|
WTable table = document.LastSection.Tables[0] as WTable;
foreach (WTableRow row in table.Rows) { foreach (WTableCell cell in row.Cells) { foreach (TextBodyItem bodyItem in cell.ChildEntities) { if (bodyItem is WParagraph) { if ((bodyItem as WParagraph).Text == "<1>") (bodyItem as WParagraph).Text = "One"; else if ((bodyItem as WParagraph).Text == "<2>") (bodyItem as WParagraph).Text = "Two"; else if((bodyItem as WParagraph).Text == "<3>") (bodyItem as WParagraph).Text = "Three"; else if((bodyItem as WParagraph).Text == "<4>") (bodyItem as WParagraph).Text = "Four"; else if((bodyItem as WParagraph).Text == "<5>") (bodyItem as WParagraph).Text = "Five"; } } } } |