hyperlink set hyperlink Nicole Scholz How can I set a hyperlink?

In this example a text is displayed as hyperlink.

/* set a hyperlink*/ /* Retrieve the Desktop object, we need its XComponentLoader interface to load a new document*/ oDesktop = UNO.createDesktop() -- get the UNO Desktop service object xComponentLoader = oDesktop~{%see com.sun.star.frame.XDesktop%XDesktop}~{%see com.sun.star.frame.XComponentLoader%XComponentLoader} -- get componentLoader interface /* open the blank file */ url = "private:factory/swriter" xWriterComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps) xDocumentFactory = xWriterComponent~{%see com.sun.star.lang.XMultiServiceFactory%XMultiServiceFactory} xTextDocument = xWriterComponent~{%see com.sun.star.text.XTextDocument%XTextDocument} xText = xTextDocument~getText() xTextCursor = xText~createTextCursor() xPropertySet = xTextCursor~{%see com.sun.star.beans.XPropertySet%xPropertySet} xDocumentFactory = xWriterComponent~{%see com.sun.star.lang.XMultiServiceFactory%XMultiServiceFactory} xTextDocument = xWriterComponent~{%see com.sun.star.text.XTextDocument%XTextDocument} xText = xTextDocument~getText() xTextCursor = xText~createTextCursor() Textprops = xTextCursor~{%see com.sun.star.beans.XPropertySet%xPropertySet} -- set a hyperlink Textprops~setPropertyValue("HyperLinkURL", "http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html") xText~insertString(xTextCursor, "module star", .false) -- insert the text with the hyperlink ::requires UNO.cls