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

get number of columns

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


Joined: 25 Feb 2010
Posts: 19

PostPosted: Thu Mar 18, 2010 6:25 am    Post subject: get number of columns Reply with quote

Hello,

Is their some function that allows you to get the number of columns? I don't mean column separators.
Because if I have 9 column separators it would mean I'd have 10 columns.. the number 10 is what I would like to get.

Any help is appreciated..
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 8995
Location: Lexinton, Kentucky, USA

PostPosted: Thu Mar 18, 2010 8:11 am    Post subject: Reply with quote

Code:
Sub ColumnCount
oSheet = ThisComponent.CurrentController.ActiveSheet
oRange = oSheet.getCellRangeByName("A1:Z50")
Print oRange.Columns.Count
oRange = oSheet.getCellRangeByName("MyRange")
Print oRange.Columns.Count
End Sub
Back to top
View user's profile Send private message
christopher23
General User
General User


Joined: 25 Feb 2010
Posts: 19

PostPosted: Fri Mar 19, 2010 2:23 am    Post subject: Reply with quote

Thanks JohnV,

apparently this works to:
Code:
table = document.createInstance("com.sun.star.text.TextTable")
remainingCols = table.Columns.Count


but wouldn't of know that Columns.Count worked unless you told me.
So thank you for that.
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