We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Changing Font with DocumentBuilder from within a replace evaluator


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.


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

Hi David,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I think, you can try using the same technique as demonstrated here:


Hope this helps.

Best regards.