Roberto Menestrina General User

Joined: 06 Jul 2004 Posts: 7 Location: Trento, Italy
|
Posted: Mon Jul 19, 2004 12:45 am Post subject: Copying TextTable in Writer |
|
|
With this little piece of code I can copy a whole TextTable, with it's sizing, formatting and content:
| Code: | Dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
ThisDoc = ThisComponent
ThisCtrl = ThisDoc.CurrentController
ThisFrame = ThisCtrl.Frame
TabColl = ThisDoc.getTextTables
OneTab = TabColl.getByIndex(...index...)
i = onetab.getcolumns.getcount
j = onetab.getrows.getcount
RangeTab = OneTab.getCellRangeByPosition(0,0,i-1,j-1)
Ans = ThisCtrl.Select(RangeTab)
Dispatcher.executeDispatch(ThisFrame, ".uno:Copy", "", 0, NoProp) |
but when the TextTable happens to be exactly 1 row and 1 column, nothing is copied.
any hint ? any workaround ?
Roberto |
|
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Mon Jul 19, 2004 9:16 pm Post subject: |
|
|
Weird behavior .
I have no fix for that, but AndrewPitonyak's document has a lot of copy-paste stuff and also without the dispatcher, so there you might find a solution.
You can find it at http://www.pitonyak.org
Christian _________________ - Knowledge is Power - |
|