Range.Replace doesnt replace all text in document

Hello!

I’m doing a proof of concept for manipulating docx and export PDF. But some text doesnt get replaced. I suspect it has to do with the format on the strings that I try to replace.

This is the code I’m using:

var doc = new Document(new MemoryStream(documentBytes));
doc.Range.Replace("testingtesting", "replacereplace", new FindReplaceOptions(FindReplaceDirection.Forward));

I can see “testingtesting” in doc.Range.Text. But it doesnt seem to replace the string.

doc.Range.Text.Replace(“testingtesting”, “replacereplace”); does replace the string but doc.Range.Text has no setter.

Here is the document I’m trying to replace text in:

CV2.zip (36.2 KB)

/Oskar

@FlexOskar,

While using the latest version of Aspose.Words i.e. 18.1, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-16400. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Thank you for your quick response. I’ll wait for an update.

@FlexOskar,

Currently, your issue is pending for analysis and is in the queue. We will inform you via this thread as soon as this issue is resolved.

The issues you have found earlier (filed as WORDSNET-16400) have been fixed in this Aspose.Words for .NET 18.3 update and this Aspose.Words for Java 18.3 update.

I’ve downloaded 18.3 and now it works.

Thank you for the help!

@FlexOskar,

Thanks for your feedback. Please let us know anytime you have any further queries.