How to apply color and underline in match the word all the places in a string?

we are using aspose-word version 14.12.0.0. Our requirement is apply color and underline in match the word all the places in a string. How can i achieve this and also we attached the sample project and screen shots for your review.

Please review the our code in attached project and give me the solution asap.

Note: Please include the dll aspose-word version 14.12.0.0.

One of our customer is waiting for this solution. Please give me the solution asap and also update code to my attached project.

UnderlineIssue.jpg (26.1 KB)
UnderlineIssue.zip (1.0 MB)

@smani

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 18.9 with following modified code and have not found the shared issue. Please make sure that the Regex you are using in your code is correct.

Regex regex = new Regex("Network", RegexOptions.IgnoreCase);
                             
ReplaceEvaluatorFindAndStyle.currentTerm = term;
FindReplaceOptions options = new FindReplaceOptions();
options.ReplacingCallback = new ReplaceEvaluatorFindAndStyle();
std.Range.Replace(regex, "", options);

Hi @ [tahir.manzoor],

we are using aspose-word version 14.12.0.0. Please give me the solution is 14.12.0.0 version.

@smani

Thanks for your inquiry. The issue is not in Aspose.Words API. You can use the old version of Aspose.Words. Please use the following line of code to test this issue. You need to modify your regex pattern according to your requirment.

Regex regex = new Regex("Network", RegexOptions.IgnoreCase);