Bernard Marcelly wrote:
Your Copy and Paste instructions work on the same range...
You have to select the origin range, Copy, select the destination range,
Another angle (that also suggests something else is wrong): I recorded a
simple macro (select all, 2x paste) in openoffice, and it looks like this:
------------- START CODE ------------------
sub AtteTest
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SelectAll",
"", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy",
"", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste",
"", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste",
"", 0, Array())
end sub
------------------ END CODE ----------------------
This suggests that selecting a range, and dispatching Paste two times
should indeed copy the selected text, something I cannot make my example do.
So another question: Don't I need to tell dispatcher which range I want
to copy from? In my code I did:
controller = doc.getCurrentController()
controller.select(rangeCursor)
frame = controller.getFrame()
properties = ()
dispatch_helper.executeDispatch(frame, ".uno:Copy", "", 0, properties)
and assumed that this would set the range. Is that infact the problem
with my code? How do control which range the dispatcher uses for it's
copy/paste operation?
--
peace, love & harmony
Atte
http://atte.dk | http://myspace.com/attejensen
http://anagrammer.dk | http://modlys.dk
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]