Thanx Rony,
Thanx for the reply...yes there is no need to create a sevice for the
HyperLinkURL we can directly set this property to the text....but in api
referance i saw that the service CharacterProperites contain the property
HyperLinkURL(see here
http://api.openoffice.org/docs/common/ref/com/sun/star/style/CharacterProperties.html
)
so i got confused with that.....now i am using the following code to hyper
link

XTextCursor curText = xText.createTextCursor();

   // get the XWordCursor interface of the document cursor
XWordCursor curWord = (XWordCursor)
       UnoRuntime.queryInterface(XWordCursor.class, curText);

   // write some text
   curText.setString("click here " + printText + " to see the source ");
       curWord.gotoNextWord(false);
       curWord.gotoNextWord(false);
       curWord.gotoNextWord(true);

       XPropertySet xProps = (XPropertySet)
           UnoRuntime.queryInterface(XPropertySet.class, curWord);
           try {
               xProps.setPropertyValue("HyperLinkURL", "
http://www.gmail.com";);
           } catch (UnknownPropertyException ex) {
               ex.printStackTrace();
           } catch (WrappedTargetException ex) {
               ex.printStackTrace();
           } catch (com.sun.star.lang.IllegalArgumentException ex) {
               ex.printStackTrace();
           } catch (PropertyVetoException ex) {
               ex.printStackTrace();
           }

Reply via email to