Hi, you should ask this question on dev@api.openoffice.org and if you provide the line failing with the exception it surely helps to find a solution.
Tom James White wrote: > Hi all, I have being trying to implement the code below (from developers > guide p.548) and I constantly run into problems, could anyone suggest a > solution or point me in the right direction to fixing the problem? > > The exception I get varies but is always one of the following: > > 1. java.lang.NullPointerException > 2. com.sun.star.lang.IllegalArgumentException: second parameter invalid > > > > > XTextDocument td = > (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class,xDesktop.getCurrentComponent()); > > XTextCursor tc = td.getText().createTextCursor(); > Object bookmark = > oobean.getMultiServiceFactory().createInstance ( > "com.sun.star.text.Bookmark" ); > XNamed xNamed = (XNamed) > UnoRuntime.queryInterface ( XNamed.class, bookmark ); > xNamed.setName("MyUniqueBookmarkName"); > XTextContent xTextContent = (XTextContent) > UnoRuntime.queryInterface (XTextContent.class, bookmark ); > td.getText().insertTextContent ( > td.getText().getEnd(), xTextContent, false ); > > > Thanks in advance for your help, > > James > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >