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

How can I insert rows into a text table

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


Joined: 09 Apr 2003
Posts: 31
Location: Germany

PostPosted: Wed Apr 09, 2003 6:18 am    Post subject: How can I insert rows into a text table Reply with quote

How can I insert rows into a text table like what the GUI does.

When youe select (e.g.) two rows in the gui and insert new rows into a text table, these two selected rows get duplicated - at least their format and number of cells.

If you use insertByIndex(rowNumber, NumberOfRows) from Basic simply the last row gets duplicated.

Anyone any idea?
Back to top
View user's profile Send private message
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Wed Apr 09, 2003 11:49 am    Post subject: Reply with quote

This works on a selection but is seriously quick and dirty from record macro!
Code:
sub cellsins
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:InsertRows", "", 0, Array())
end sub
Back to top
View user's profile Send private message
Skeeve
General User
General User


Joined: 09 Apr 2003
Posts: 31
Location: Germany

PostPosted: Thu Apr 10, 2003 10:06 am    Post subject: Reply with quote

not what I need.

To be more specific: I have to find two bookmarks marking two cells ikn a text table.

So far no problem.

Then I have to select the rows between the two bookmarks.

That's the problem

And then I can insert/duplicate them.

The problem is doing the selection or working with the model cursor and finding out how to simulate the GUI's behaviour.
Back to top
View user's profile Send private message
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