Page 1 of 1

[Solved] Determine location for Paste operation

Posted: Mon Nov 07, 2022 12:57 pm
by wanglong
I'd like to use UNO with JAVA to copy some contents from one doc to another like this:

Code: Select all

xDispatchHelper.executeDispatch(xDispatchProvider, ".uno:Paste", "", 0, new PropertyValue[]{new PropertyValue()});
But I didn't find a convenient way to locate my "Paste" position,except ".uno:GoToNextPara",".uno:JumpToNextPara"and so on. :crazy:
And I don't know how the interface is implemented.So I don't know these ".uno:GoToxxxx" API influence which cursor.
Thus I want to know:
1、Can I use just an UNO command with some information to make it paste to the desired position?
2、I didn't find a detialed description with UNO command besides "https://wiki.openoffice.org/wiki/Framew ... x_Commands"
,but it didn't describe parameters.Please show me a link.

I really appreciate your help.

Re: Is there one more way trace to my "Paste" location?

Posted: Mon Nov 07, 2022 1:19 pm
by Villeroy

Re: Is there one more way trace to my "Paste" location?

Posted: Mon Nov 07, 2022 6:23 pm
by JeJe
The paste occurs at the position of the document's current controller viewcursor and the cursor is then moved to the end of whatever is pasted.

Instead of using dispatch calls you should learn how to move the viewcursor, create a textcursor and so on with api calls.

Re: Is there one more way trace to my "Paste" location?

Posted: Tue Nov 08, 2022 1:09 pm
by wanglong
OK!
I make it with TextviewCursor!
Thank u very much,Jeje and Villeroy! :bravo: :bravo: :bravo: