Hi Oliver,
> oSrcDoc.CurrentController.Select(oSrcSection.Anchor)
> oDispatcher.executeDispatch(oSrcDispFrame, ".uno:Copy", "", 0, arr())
> oDstDoc.CurrentController.Select(oDstSection.Anchor)
> oDispatcher.executeDispatch(oDstDispFrame, ".uno:Paste", "", 0, arr())
now I implemented it and it works. Even the styles are copied - wonderful!
Here is my java code:
-----%<-----
public void dispatchCommandURL(String myCommandURL,
PropertyValue[] myProperties) {
// Getting the frame the loaded document resides in
XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class,
this.xComponent);
XController xController = xModel.getCurrentController();
// Getting the Dispatch Provider
XDispatchProvider xDispatchProvider = (XDispatchProvider)
UnoRuntime.queryInterface (XDispatchProvider.class,
xController.getFrame());
// Getting the Dispatch Helper
XMultiServiceFactory xMultiServiceManager = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class,
OOWorkbench.getXComponentContext().getServiceManager());
XDispatchHelper xDispatchHelper = null;
try{
Object oDispatchHelper = xMultiServiceManager.createInstance(
"com.sun.star.frame.DispatchHelper");
xDispatchHelper = (XDispatchHelper)
AnyConverter.toObject(XDispatchHelper.class,
oDispatchHelper);
}
catch(com.sun.star.uno.Exception e)
{
}
// Executing the commandURL
xDispatchHelper.executeDispatch(xDispatchProvider,
myCommandURL,
"_self",
0,
myProperties);
}
-----%<-----
Thanks again.
Greetings, Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]