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

API OpenOffice and Visual Basic
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
ValM
General User
General User


Joined: 05 Aug 2004
Posts: 6
Location: Nantes, FRANCE

PostPosted: Thu Aug 05, 2004 2:14 am    Post subject: API OpenOffice and Visual Basic Reply with quote

Hello everyone,

I'm French, excuse my English very bad...
I want to use API OpenOffice under an application Visual BASIC. Are all the services of API OpenOffice accessible under Visual BASIC?

I succeeded in opening, modifying and saving a document but I does not succeed to recover information on the OpenOffice application or an open document (exemple : document file name, ruler option, etc... ).

In many macro's exemple i see this syntaxe : createUnoService("com.sun.star....")
can i use an equivalent syntax in Visual Basic ?

Thank's for your help !
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: Thu Aug 05, 2004 6:20 am    Post subject: Reply with quote

Yes you can.
Have a look at: http://www.oooforum.org/forum/viewtopic.php?t=9815

That should give you the necessary links and information to start with VB for OpenOffice.org .

Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
ValM
General User
General User


Joined: 05 Aug 2004
Posts: 6
Location: Nantes, FRANCE

PostPosted: Thu Aug 05, 2004 7:38 am    Post subject: Reply with quote

Very good ! Thank's
Back to top
View user's profile Send private message
ValM
General User
General User


Joined: 05 Aug 2004
Posts: 6
Location: Nantes, FRANCE

PostPosted: Fri Aug 06, 2004 12:59 am    Post subject: Reply with quote

Hello,

Under Visual BASIC I launched this code:
Quote:
Set puoServiceManager = CreateObject("com.sun.star.ServiceManager")

puoServiceManager.getavailableServiceNames()


It does not return me the service com.sun.star.view.ViewSettings. How can I do to reach the module view and its services?

Thank's
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Aug 06, 2004 5:43 am    Post subject: Reply with quote

Here is how in OOo Basic...
Code:
Sub Main
   oDoc = ThisComponent
   oDocCtrl = oDoc.getCurrentController()
   oViewSettings = oDocCtrl.getViewSettings()
   oViewSettings.ShowHoriRuler = True
End Sub


You must get the document's controller which has the OfficeDocumentView service. From here, you can see that OfficeDocumentView implements the XViewSettingsSupplier interface. As you can see, the XViewSettingsSupplier interface, provides a method getViewSettings(). By calling the getViewSettings() method, you get back a ViewSettings, which is what you want.

Please note that the XViewSettingsSupplier interface only appears to be available in Text documents.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
ValM
General User
General User


Joined: 05 Aug 2004
Posts: 6
Location: Nantes, FRANCE

PostPosted: Fri Aug 06, 2004 8:01 am    Post subject: Reply with quote

Thank you, I have much evil to understand the bond between the services... The most interesting of documentations are in English and it's not really funny for me. Confused

There is not a French in this forum, enough motivated, to translate the Developer's Guide ? Very Happy

Excuse my bad English...
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: Fri Aug 06, 2004 8:19 am    Post subject: Reply with quote

AndrewPitonyak's document has been translated into french I think.
-> http://www.pitonyak.org

Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Fri Aug 06, 2004 10:08 am    Post subject: Reply with quote

Quote:
There is not a French in this forum, enough motivated, to translate the Developer's Guide ?

Hi,
You should browse the french forums at :
http://fr.openoffice.org/servlets/ProjectMailingListList
You may ask such questions in the forum prog@fr.openoffice.org but you can read several documents in french at :
http://fr.openoffice.org/Documentation/How-to/indexht.html
see in that page the section : Programmation Basic

Bernard
Back to top
View user's profile Send private message Visit poster's website
ValM
General User
General User


Joined: 05 Aug 2004
Posts: 6
Location: Nantes, FRANCE

PostPosted: Sun Aug 08, 2004 11:15 pm    Post subject: Reply with quote

I already downloaded several French documentations but most interesting remain in English, normal the developers are english-speaking...

I go to try the French forum.

Thank's for all
Back to top
View user's profile Send private message
Didier ALAIN
General User
General User


Joined: 14 Aug 2004
Posts: 17
Location: Paris, France

PostPosted: Tue Aug 17, 2004 1:01 am    Post subject: Reply with quote

Hi valm,

I'm aslo a french user, and also a (part-time) Visual Basic programmer. I meet the same difficulties as you in the understanding of the API (and writing English !). I'll probably write a tutorial "programming OpenOffice with Visual Basic" as soon as my understanding of the API is sufficient... A already wrote some parts of it. I will very soon release some preview versions in the french "community" to test its pertinence and utility (no translation for the moment, sorry !). Your contribution will be very appreciated !

Anybody knows about a document like this (english or french) ? I'm looking for a document which explains the main difficulties with the UNO-Automation bridge : events handlings, the global logic of the API for a non Object Oriented language user, etc... Do you think that a document like that could be of any use ?

I already used many contributions found in OOoforum and wish to particularly thank the moderators DannyB and Andrew Pitonyak, and the other contributors.
_________________
Didier ALAIN, IT consultant
KaliTech (http://www.kalitech.fr)
Back to top
View user's profile Send private message Visit poster's website
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Thu Aug 19, 2004 5:32 am    Post subject: Reply with quote

All new documentation is interesting even in french. It will be translated later... I cannot imagine translate french into english because this later is too bad. To translate english into french perhaps a day ... I am busy with an other documentation now probably for a year...
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Didier ALAIN
General User
General User


Joined: 14 Aug 2004
Posts: 17
Location: Paris, France

PostPosted: Thu Aug 19, 2004 6:10 am    Post subject: Reply with quote

Thanks a lot for your reply, SergeM (et bonjour à toi et à Troyes ! hum...),

The doc is here : http://www.kalitech.fr/clients/doc/VB_APIOOo_fr.html. I think that I will translate this doc to english as soon as possible and will maintain only the english version. The audience is larger, and there are more contributors. But I'm not very sure with my english, so I would appreciate some help for the correction... (english or french readers are OK for that !).
_________________
Didier ALAIN, IT consultant
KaliTech (http://www.kalitech.fr)


Last edited by Didier ALAIN on Tue Aug 24, 2004 4:08 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3618
Location: Columbus, Ohio, USA

PostPosted: Thu Aug 19, 2004 5:34 pm    Post subject: Reply with quote

Thank you for your kind words... If you want French...

Voici la traduction française de mon document, effectuée par le projet Documentation de la branche française d'OpenOffice sous le nom de "Eléments de programmation des macros dans OOo". Mon document original contient plus d'informations car mis à jour depuis la dernière traduction. Ce lien vous mènera directement sur la page Web contenant cette traduction.

http://fr.openoffice.org/Documentation/Guides/Indexguide.html
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Thu Aug 19, 2004 11:05 pm    Post subject: Reply with quote

Didier Alain
I have read your document. I am not a VB user but I encourage you to continue. I am not sure with my english too but I try to write directly the documentation in english with the help of this forum (and translate it in french after)
I have a (very) little experience with event listener in OOoBasic and can help if you want (use private message of this forum if you want)
Bonjour de Troyes au Parisien.
Andrew
Your french is very good.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Didier ALAIN
General User
General User


Joined: 14 Aug 2004
Posts: 17
Location: Paris, France

PostPosted: Fri Aug 20, 2004 1:34 am    Post subject: Reply with quote

pitonyak
(And after that, no more compliments, it's bad for mental health Very Happy )
Your online doc is a must read/have, I already read and used many parts of it, of course !

SergeM
thank you for your proposal about event handling. I'm going to work on it this week-end (priority number 2) to make the first steps (there are many ressources on it in this forum). I'll write my understanding with VB and event handling in my doc.

My doc concentrate on specificities with Visual Basic language. There are not many specificities, but these ones are very tricky in the firts steps. As far as I know, no document like that is accessible on the web, which is a pity for an OOoAPI beginner as I am...

I'm going to translate the doc (it's short for the moment) this week-end (priority number 1) and will put it online. I would really appreciate your remarks on :

-technical aspects, of course
-correctness & quality of expression (don't hesitate !)
_________________
Didier ALAIN, IT consultant
KaliTech (http://www.kalitech.fr)
Back to top
View user's profile Send private message Visit poster's website
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
Goto page 1, 2  Next
Page 1 of 2

 
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