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

Newbie question, and I'm new here

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






PostPosted: Sun Jan 18, 2004 7:59 am    Post subject: Newbie question, and I'm new here Reply with quote

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 Embarassed

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 Laughing You must have another documentation, or you have a lot of time Laughing

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 Wink
Back to top
Comran
Newbie
Newbie


Joined: 18 Jan 2004
Posts: 2

PostPosted: Sun Jan 18, 2004 8:01 am    Post subject: Reply with quote

Ooops, now I logged in with my account Shocked
Back to top
View user's profile Send private message
Toxitom
General User
General User


Joined: 13 Jan 2004
Posts: 9
Location: Wiesbaden, Germany

PostPosted: Sun Jan 18, 2004 9:04 am    Post subject: Reply with quote

Hi Comran,

a very good first step exploring the basic-IDE and simple commands is the Sun Programmers Guide, which you can find at:
ftp://docs-pdf.sun.com/817-1826-10/817-1826-10.pdf
The same document ist translated to German:
http://docs.sun.com/db/doc/817-3924?l=de

Referenz to your Combo-Box Question:
have a look at http://www.amt-wiesbaden.de, there you will find some nice exambles of using Basic-Code, even Comboboxes (include "Additem" ...)
Try "Fahrtenbuch_Muster" , it still have a good documentation (in german!)

Thomas
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sun Jan 18, 2004 9:28 am    Post subject: Reply with quote

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
OOo Enthusiast


Joined: 15 Jan 2004
Posts: 118

PostPosted: Sun Jan 18, 2004 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Comran
Newbie
Newbie


Joined: 18 Jan 2004
Posts: 2

PostPosted: Sun Jan 18, 2004 10:22 am    Post subject: Re: Newbie question, and I'm new here Reply with quote

Thank you very much, everyone. Smile Smile Smile

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
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