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

Free Support Forum - aspose.com

Improve Find and Replace Feature in Aspose.Words 16.7 | FindReplaceOptions

Hi there,
I’m trying to adapt old code that used a 2011 version of Aspose to use the lastest version. You have sent me documentation, so thanks for that. Just one thing I would like to ask is that we have a couple of lines where our previous programmer has passed the first parameter as a Regex object and the Second as an internal Class that implements IReplacingCallback. Seeing as the Types for the first two parameters can now only be passsed as a String, how would I now pass these two objects so the functionality remains consistent with the old version of Aspose. Code is below.
doc.Range.Replace(New Regex("«TableStart:Suppliers»"), New ReplaceWithHtmlEvaluator_PartyMember)

I think I may have resolved it but not sure. Just going to test it
Dim RangeOptions As New FindReplaceOptions()
RangeOptions.ReplacingCallback = New ReplaceWithHtmlEvaluator_PartyMember
doc.Range.Replace(New Regex("«TableStart:Suppliers»"), “”, RangeOptions)


It is nice to hear from you that your problem has been solved. The find and replace APIs was changed in Aspose.Words 16.7. Please check the API changes from here:


We suggest you please check the code examples in the following article.