| View previous topic :: View next topic |
| Author |
Message |
Demelene General User

Joined: 27 Apr 2004 Posts: 7
|
Posted: Fri Apr 30, 2004 12:46 am Post subject: GetAvailableServiceNames and supportsService |
|
|
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 |
|
 |
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Fri Apr 30, 2004 11:01 am Post subject: |
|
|
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 |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Apr 30, 2004 12:52 pm Post subject: |
|
|
| 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 |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Sat May 01, 2004 7:53 pm Post subject: |
|
|
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 |
|
 |
|