21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tools for Working with UNO 69<br />

Debug Properties<br />

Every UNO object in <strong>OpenOffice</strong>.<strong>org</strong> Basic knows what properties, methods and interfaces<br />

it already contains. It provides properties that return these in the form of a list. The<br />

corresponding properties are:<br />

DBG_properties<br />

returns a string containing all properties of an object<br />

DBG_methods<br />

returns a string containing all methods of an object<br />

DBG_supportedInterfaces<br />

returns a string containing all interfaces which support an object.<br />

The following program code shows how DBG_properties and DBG_methods can be used in<br />

real-life applications. It first creates the<br />

com.sun.star.frame.Desktop<br />

service and then displays the supported properties and methods in message boxes.<br />

Dim Obj As Object<br />

Obj = createUnoService("com.sun.star.frame.Desktop")<br />

MsgBox Obj.DBG_Properties<br />

MsgBox Obj.DBG_methods<br />

When using DBG_properties, note that the function returns all properties that one<br />

particular service can theoretically support. No assurances are, however, provided for<br />

whether these can also be used by the object in question. Before calling up properties, you<br />

must therefore use the IsEmpty function to check whether this is actually available.<br />

API Reference<br />

More information about the available services, and their interfaces, methods and properties<br />

can be found in the reference for the <strong>OpenOffice</strong>.<strong>org</strong> API [1] .<br />

External links<br />

[1] http:/ / api. openoffice. <strong>org</strong>/ docs/ common/ ref/ com/ sun/ star/ module-ix. html<br />

Source: http:/ / <strong>wiki</strong>. services. openoffice. <strong>org</strong>/ w/ index. php? title=Documentation/ <strong>BASIC</strong>_<br />

<strong>Guide</strong>/ UNO_ Tools&oldid=96866<br />

Principal Authors: Fpe, Ccornell, TJFrazier, Billiam

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!