When I try to duplicate some textcontent from one Doc to another with below code,
Code: Select all
// Loop through all paragraphs of the document
while ( xParagraphEnumeration.hasMoreElements() ) {
xTextElement = (com.sun.star.text.XTextContent)
UnoRuntime.queryInterface(
com.sun.star.text.XTextContent.class,
xParagraphEnumeration.nextElement());
try
{
outText.insertTextContent(outText.getEnd(),xTextElement,false);
}
catch ( java.lang.Exception e )
{
e.printStackTrace();
}
}
Code: Select all
com.sun.star.uno.RuntimeException:
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:173)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:139)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:334)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:303)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:87)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:636)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:146)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:128)
at com.sun.proxy.$Proxy9.insertTextContent(Unknown Source)
at TemplateConfigurator.text.ParseUITextDocument.readParagraph(ParseUITextDocument.java:60)
So,I want to known how to duplicate an old TextContent already existed in Text Doc?
Thanks in advance.