Hi Ann,
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);
looks good so far ... additionally you should set the property
"Representation" which doesn't seem to be set automatically in
Draw/Impress ... e.g.
xPS.setPropertyValue("Representation","http://www.openoffice.org");
Hope that helps
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]