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

GetAvailableServiceNames and supportsService

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


Joined: 27 Apr 2004
Posts: 7

PostPosted: Fri Apr 30, 2004 12:46 am    Post subject: GetAvailableServiceNames and supportsService Reply with quote

Taking into concideration that is VBScript Code i have written these two function
Code:
function GetSupportedServices(xObj)
   Dim ServicesList
   ServicesList=xObj.GetAvailableServiceNames
   GetSupportedServices=CovertStringListToString(ServicesList)
End Function
function CovertStringListToString(StrList)
   Dim str
   CovertStringListToString=""
   for each str in StrList
      CovertStringListToString=CovertStringListToString+str+chr(13)
   next
End Function   


If you use
Code:
msgBox GetSupportedServices(xObj)
then you will be listed with alla available services.
Then when using one of the above with
Code:
xObj.supportsService
it returns false.
Why, isn't the method GetAvailableServiceNames provide all supported services?? What is wrong in my understang of OpenOffice.
Thank you
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 Apr 30, 2004 11:01 am    Post subject: Reply with quote

I believe that getAvailableServiceNames is an array, so if you want to get all the names, then just loop through every single element of this array with a msgbox at the end so that you'll see every single ServiceName of the Object.
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
DannyB
Moderator
Moderator


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

PostPosted: Fri Apr 30, 2004 12:52 pm    Post subject: Reply with quote

Demelene wrote:
What is wrong in my understang of OpenOffice


From what I can see, you appear to understand correctly. I cannot say why it does not work as you expect.

You are passing fully qualified service names to supportsService aren't you? I mean a full name such as com.sun.star.draw.DrawingDocument.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


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

PostPosted: Sat May 01, 2004 7:53 pm    Post subject: Reply with quote

If the object is an UNO object (and not a structure, for example) then you can inspect the object:

UNO objects, usually support the ServiceInfo service as mentioned above. The object method getImplementationName() returns the fully qualified name of the object. From this, I search Google or the developers guide to find more information. The object method getSupportedServiceNames() returns a sequence of all interfaces supported by the object. A very common method finding out what an object can do is to call the following three methods:
Code:
MsgBox  vObj.dbg_methods
MsgBox  vObj.dbg_supportedInterfaces
MsgBox  vObj.dbg_properties



There are differences between the supported interfaces and the supported services. My macro document contains some examles of this sort of thing...
_________________
--
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
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