Hi there,
As u set i had set the property HyperLinkURL using the following code
// get the document container
XText xText = xTextDocument.getText();
// create text cursor for selecting and formatting
XTextCursor curText = xText.createTextCursor();
// get the XWordCursor interface of the document cursor
XWordCursor curWord = (XWordCursor)
UnoRuntime.queryInterface(XWordCursor.class, curText);
// get the XMultiServiceFactory interface
XMultiServiceFactory mxDocFactory = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class,
xTextDocument);
// write some text
curText.setString("How to create and apply style.");
// create a new style
// get the CharacterStyle service
Object oCharacterStyle =
mxDocFactory.createInstance
("com.sun.star.style.CharacterStyle");
No need to create a new style, you can get the XPropertySet directly
from your "curText" with something like
XPropertySet curProps = (XPropertySet) UnoRuntime.queryInterface
(XPropertySet.class, curText);
but it is showing the following exeception
Exception in thread "main"
com.sun.star.beans.UnknownPropertyException:
Unknown property: HyperLinkURL at
com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedExc
eption
(Job.java:275)
but the same code works for CharHeight,Charweight and CharUnderline
charcter
properties
what is wrong ?
The property is optional and not implemented at you newly created
style, but your cursor supports css.style.CharacterProperties and
these will support the mentioned property.
Hope that helps
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]