| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sun Jan 18, 2004 7:59 am Post subject: Newbie question, and I'm new here |
|
|
Hi! I'm Comran from Germany, and I will join you here because since 3 days I started working with OpenOffice API. I will port some macros for a lot of documents I did in StarOffice 5.1.
I am experienced with C++, Basic, Java and some other product languages. After changing to OpenOffice I have to admit that the start with UNO is one of the heaviest I ever experienced
My first simple question: how did you find an entrance to the OOo-API? I have the SDK with the developers guide and the API reference, but I ask myself if this is all. I find no simple structure to start with and have no concept. For example: in many code snippets I find the access to a spreadsheet like "ThisComponent.sheets (x)". What's about this sheets-Array? Where do you find an explanation for it in the SDK documentation? If I look for a SpreadsheetDocument service I only find the XSpreadsheetDocument interface with a getSheets-Method. OK, this works, but I hate finding code which I can't explain by myself You must have another documentation, or you have a lot of time
At the moment I fight with a combobox within a spreadsheet. I want to use the "addItems"-Method, but I can't find a way to the control - only to the component (which does not provide "addItems"). How do I do that?
OK, I will read a lot of threads here, and perhaps my question had already appeared in the past, but any hint will be appreciated. That was my introduction, and I hope to get in closer touch with this API one day and may give answers here, too, one day  |
|
| Back to top |
|
 |
Comran Newbie

Joined: 18 Jan 2004 Posts: 2
|
Posted: Sun Jan 18, 2004 8:01 am Post subject: |
|
|
Ooops, now I logged in with my account  |
|
| Back to top |
|
 |
Toxitom General User

Joined: 13 Jan 2004 Posts: 9 Location: Wiesbaden, Germany
|
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jan 18, 2004 9:28 am Post subject: |
|
|
| You might also find www.ooomacros.org useful. There is a macro there called X-Ray, which is particulartly useful. |
|
| Back to top |
|
 |
Henrik OOo Enthusiast

Joined: 15 Jan 2004 Posts: 118
|
Posted: Sun Jan 18, 2004 10:17 am Post subject: |
|
|
Hi,
you might take a look at the thread "getControl() and ActiveSheet". Anyway here are some code so you'll be able to use addItem:
Dim oSheet As Object
oSheet = ThisComponent.Sheets.GetByName(sheetName) 'Sheet1
Dim oDpage As Object
oDpage = oSheet.DrawPage
Dim oForm As Object
oForm = oDpage.Forms.getByName(formName) 'Standard
Dim oCtrlModell As Object
Dim oCtrl As Object
oCtrlModell = oForm.getByName(listboxName) 'listbox
oCtrl = ThisComponent.CurrentController.getControl(oCtrlModell)
oCtrl.addItem("Item #1")
Henrik |
|
| Back to top |
|
 |
Comran Newbie

Joined: 18 Jan 2004 Posts: 2
|
Posted: Sun Jan 18, 2004 10:22 am Post subject: Re: Newbie question, and I'm new here |
|
|
Thank you very much, everyone.
The basic cookbook was what I was missing. I downloaded the german version and will try this out. I looked at the code samples and I think that especally the introduction to StarBasic with the API was my lack.
But nevertheless: the workflow with the old StarOffice-API was much better... |
|
| Back to top |
|
 |
|
|
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
|