I have tried replacing all paragraphs in my writer file with the following code:
Code: Select all
XReplaceable xReplaceable = UnoRuntime.queryInterface(XReplaceable.class, document);
XReplaceDescriptor xRepDesc = xReplaceable.createReplaceDescriptor();
xRepDesc.setSearchString("$");
xRepDesc.setReplaceString("");
PropertyValue[] aReplaceArgs = new PropertyValue[1];
aReplaceArgs[0] = new PropertyValue();
aReplaceArgs[0].Name = "SearchRegularExpression";
aReplaceArgs[0].Value = true;
XPropertyReplace xPropRepl = UnoRuntime.queryInterface(XPropertyReplace.class, xRepDesc);
xPropRepl.setReplaceAttributes(aReplaceArgs);
// replace
long nResult = xReplaceable.replaceAll(xRepDesc);
Code: Select all
com.sun.star.beans.UnknownPropertyException:
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:177)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:143)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:335)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:304)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:91)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:639)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:151)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:133)
at com.sun.proxy.$Proxy67.setReplaceAttributes(Unknown Source)