Atte André Jensen wrote:
Hi
this code works in basic
first "select the textportion and then uses this code:
yourdocument = oDoc.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(yourdocument, ".uno:Copy", "", 0, Array()) >>
copies only yhe "selected portion"
dispatcher.executeDispatch(yourdocument, ".uno:Paste", "", 0, Array())
>> paste at the viewcursor
hope it helps
fernand
I'm trying to copy a part of a document while preserving the
formatting with python. Here's the code I have:
print rangeCursor.String
controller = doc.getCurrentController()
controller.select(rangeCursor)
frame = controller.getFrame()
properties = ()
dispatch_helper.executeDispatch(frame, ".uno:Copy", "", 0, properties)
dispatch_helper.executeDispatch(frame, ".uno:Paste", "", 0, properties)
dispatch_helper.executeDispatch(frame, ".uno:Paste", "", 0, properties)
The print ensures me that rangeCursor is infact containing the desired
text, but still no copying is happening. I'm thinking the problem is
the dispatch is not using the desired text... Anyone able to help me a
bit further?
Also, I'm quite confused about the documentation, in this case I'd
like to see a list of that properties could be/do. I guess it should
be different for Copy and Paste, but where is this documented?
Thanks in advance for any input!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]