Stephan,
Thanks for all the pointers. I am no longer getting any errors in running
the code. However, I am not seeing any links in the resulting document.
Could it be because I am using OpenOffice.org 1.1, or that I am trying
also to output it as a PowerPoint file?
Here is a code snippet:
// xPresentation is an impress presentation
XDrawPage xDrawPage = PageHelper.getDrawPageByIndex(xPresentation, 0);
XMultiServiceFactory xFactory =
(XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class,
xPresentation);
Object xObj = xFactory.createInstance("com.sun.star.drawing.TextShape");
XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, xObj);
xShape.setPosition(aPos);
xShape.setSize(aSize);
XText xText = (XText)UnoRuntime.queryInterface(XText.class, xShape);
XTextCursor xTextCursor = xText.createTextCursor();
Object o = xFactory.createInstance("com.sun.star.text.TextField.URL");
XTextContent xTC = (XTextContent)
UnoRuntime.queryInterface(XTextContent.class, o);
XPropertySet xPS = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xTC);
xPS.setPropertyValue("URL","http://www.openoffice.org");
xText.insertTextContent(xTextCursor, xTC, true);
xDrawPage.add(xShape);
As you can see, I have a presentation document where I am trying to add a
URL to a TextShape. However, the resulting document doesn't show the URL
at all, either as a link or even as text. If I add text to the end of the
TextShape that is not a URL (using ShapeHelper.addPortion), then I can see
the text fine. Any ideas I so I can get the URL to show and link
correctly? Or so that I can debug further?
Thanks,
Ann
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]