Closed Golenko closed 7 years ago
Hi Golenko, Please use the latest version of Aspose.Words for Java 16.11.0.
I have tested ReplaceWithString example and it is running perfectly fine. I used this file as input and it produces this file as output.
Thanks for your answer! 16.6.0 is the newest version supported by the license I have. Is there any examples for older versions?
Yes, three APIs are available in v16.6.0 for “Find and Replace” feature.
replace(Pattern pattern, String replacement)
replace(String oldValue, String newValue, boolean isMatchCase, boolean isMatchWholeWord)
replace(Pattern pattern, IReplacingCallback handler, boolean isForward)
Example 1:
Document doc = new Document(dataDir + "ReplaceWithString.doc");
doc.getRange().replace(Pattern.compile("[s|m]ad"), "bad");
doc.save(dataDir + "ReplaceWithString_out.doc");
Example 2:
Document doc = new Document(dataDir + "ReplaceWithString.doc");
doc.getRange().replace("sad", "bad", false, true);
doc.save(dataDir + "ReplaceWithString_out.doc");
Thanks a lot!
Hello guys, I'm trying to execute this example
The problem is that classes FindReplaceOptions and FindReplaceDirection are absent from com.aspose.words package.
The version of the jar I use is aspose-words-16.6.0-jdk16.jar
Is that something that expected and example should be updated?
Thanks.