How to access texts in slide on impress?
And I just start to write code for impress.
Please introduce me good sites showing examples.
I couldn't find examples for impress.
https://wiki.openoffice.org/wiki/API/Samples/Java
[Solved] Get and set texts in slides on impress
[Solved] Get and set texts in slides on impress
Last edited by robleyd on Wed Jul 28, 2021 7:39 am, edited 2 times in total.
Reason: Add green tick
Reason: Add green tick
OpenOffice 3.1 on Windows 10
Re: Get and set texts in slides on impress
I reached to get a text from a shape in a slide on Impress.
Is it XDrawPagesSupplier on Impress correspoinding to XTextDocument on Writer or XSpreadsheetDocument on Calc...?
Is it XDrawPagesSupplier on Impress correspoinding to XTextDocument on Writer or XSpreadsheetDocument on Calc...?
Code: Select all
XMultiComponentFactory manager = context.getServiceManager();
Object desktop_obj = manager.createInstanceWithContext(
"com.sun.star.frame.Desktop", context);
XDesktop desktop = UnoRuntime.queryInterface(XDesktop.class, desktop_obj);
XComponent comp = desktop.getCurrentComponent();
XDrawPagesSupplier page_sup = UnoRuntime.queryInterface(XDrawPagesSupplier.class, comp);
XIndexAccess ia = UnoRuntime.queryInterface(XIndexAccess.class, page_sup.getDrawPages());
XShapes shapes = UnoRuntime.queryInterface(XShapes.class, ia.getByIndex(0));
XText xtext = UnoRuntime.queryInterface(XText.class, shapes.getByIndex(0));
System.out.println(xtext.getString());
OpenOffice 3.1 on Windows 10