OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Copying TextTable in Writer

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Roberto Menestrina
General User
General User


Joined: 06 Jul 2004
Posts: 7
Location: Trento, Italy

PostPosted: Mon Jul 19, 2004 12:45 am    Post subject: Copying TextTable in Writer Reply with quote

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
Back to top
View user's profile Send private message
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Mon Jul 19, 2004 9:16 pm    Post subject: Reply with quote

Weird behavior Confused .
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 -
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group