Hi Michael,

Michael Mi wrote:
Hi,

Here is some code from StarBasic, like

 oDoc = ThisComponent
 oUrl = oDoc.createInstance("com.sun.star.text.TextField.URL")
 oUrl.URL = "http://www.openoffice.org";

// assume that you already have a text document
// get the service factory from the text document
XMultiServiceFactory xFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextdocument)

// create a new URL service object
Object obj = xFactory.createInstace("com.sun.star.text.TextField.URL")

// get the property set interface
XPropertySet xPropset = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, obj)

// set the property
// NOTE: the second parameter is an Any whicih is mapped in java to
// object.
xPropset.setProbertyValue("URL", "http://www.openoffice.org";)

Juergen





Can anyone tell me how to write the same function in Java?

(I am wondering what the "ThisComponent" represents in Java.)

Thanks.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to