Hi
Find and replace is not working in my docx. Can you please check?
Thanks
Gaurav
Hi
Find and replace is not working in my docx. Can you please check?
Thanks
Gaurav
@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");
doc.save("C:\\Temp\\out.docx");
out.docx (13.9 KB)
It’s not working when I am using the following find and replace option.
FindReplaceOptions findReplaceOptions = new FindReplaceOptions();
findReplaceOptions.setFindWholeWordsOnly(true);
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: