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

Free Support Forum - aspose.com

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

Hi,


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.

Thanks

I’ve attached a nice working example here.


Did anybody try it out?

Hi

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

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:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/howto-find-and-highlight-text.html

I suppose you can reuse technique of splitting runs, provided in this article, in your code.

Best regards.

Thank you.

It’s working now.