Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for additional information. I think that you can try using the following code.
public void Test080()
{
Document doc = new Document(@"Test080\in.doc");
//Create regex
Regex regex = new Regex("test");
foreach (Section section in doc.Sections)
{
//Process only body
section.Body.Range.Replace(regex, new ReplaceEvaluator(Replace080), false);
}
//Save output document
doc.Save(@"Test080\out.doc");
}
ReplaceAction Replace080(object sender, ReplaceEvaluatorArgs e)
{
//Change color
(e.MatchNode as Run).Font.Color = Color.Red;
return ReplaceAction.Skip;
}
Hope this helps.
Best regards.