Aspose.words misses the replacement text ver (Platform: Microsoft Word)


My replacement works perfectly for the first string.

From there on it goes off until it misses the text that’s being passed to the Run.

Any suggestions would be appreciated.


I’ve attached a nice working example here.

Did anybody try it out?


Thanks for your request. I changed one line in your code and it seems all works fine on my side. Here is changed line:
objDoc.Range.Replace(regex, New Words.ReplaceEvaluator(AddressOf ReplaceEvaluator), False)
I highlighted my changes.
Also, I think code provided in the following article could be useful for you:
I suppose you can reuse technique of splitting runs, provided in this article, in your code.
Best regards.

Thank you.
It’s working now.