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

Free Support Forum - aspose.com

Find and replace not working

Find and replace is not working in my docx. Can you please check?


test.docx (22.7 KB)

I tried replacing the text SunBurn.

@gkumar16 I have checked with the following simple code and text is replaced properlu:

Document doc = new Document("C:\\Temp\\in.docx");
doc.getRange().replace("SunBurn", "REPLACED");

out.docx (13.9 KB)

It’s not working when I am using the following find and replace option.

FindReplaceOptions findReplaceOptions = new FindReplaceOptions();

document.getRange().replace("SunBurn.", "REPLACED", findReplaceOptions);

@gkumar16 This is expected behavior. If you search “SunBurn” with Find whole words only in MS Word, it also does not match anything:

Thank you for clarifying.

1 Like