openoffice-impress

LibreOffice how to recup the current element

蓝咒 提交于 2021-01-28 20:16:39
问题 I want to retrieve the current element in LibreOffice Impress to apply changes to it. For example, I'm trying to retrieve this shape to change the text in it with macros. I tried to find information with the X-ray tool but without success. 回答1: To get the currently selected shape: oSel = ThisComponent.getCurrentController.getSelection() oShape = oSel.getByIndex(0) Print oShape.getString() To iterate through all shapes in the slide, start with ThisComponent.getDrawPages() and then use XrayTool