Changing Font with DocumentBuilder from within a replace evaluator

Hello,

I’m using the Replace method on a Range to identify text within a word document to be replaced. Part of the replacement is that I need to set the Font to bold and Underlined. I’m attempting to use the DocumentBuilder on the MatchNode and set the font settings from there, however my updates don’t seem to be effecting the resulting text. Can you please tell me the correct way to achieve this.

David

DocumentBuilder builder = new DocumentBuilder(e.MatchNode.Document);
builder.MoveTo(e.MatchNode);
builder.Font.Underline = Underline.Dash;
builder.Font.Bold = true;
e.Replacement = this.tag.Value;

Hi David,

Thanks for your request. I think, you can try using the same technique as demonstrated here:
https://docs.aspose.com/words/net/find-and-replace/
Hope this helps.
Best regards.