

If you have any questions, drop a note below.Azhagi+ is a supremely easy, fast, unique and feature-rich transliteration software. I hope this clarifies the very basics of Impress presentation macro.

Msg = msg & "slide 2 - text 2 : " & oItem.getString & Chr(13) Msg = msg & "slide 2 - text 1 : " & oItem.getString & Chr(13) Msg = msg & "slide 1 - text 2 : " & oItem.getString & Chr(13) Msg = "slide 1 - text 1 : " & oItem.getString & Chr(13) If oItem.ShapeType = ".TitleTextShape" Then You can copy this and paste it to the Impress macro editor, which can be accessed from Tools -> Macros -> Organize Macros -> LibreOffice Basic. Here is the complete macro used in this article. The contents from the slides are shown in the message box you can also use the contents this way as per your needs.

Same way, you can access all the textboxes of the slides. The item’s getString property returns the contents of the textbox. If oItem.ShapeType = " .TitleTextShape" Then It is sometimes needed because you may not find the text contents for an image box. You can also check the object types (text box for this example) before you access the contents. Similarly, the snippets below can be used to access all the text boxes. To get the first text box in the first slide, the below can be used. For this tutorial, we have two text boxes on each slide. Once we have the slide, we can access the objects inside the slides. If you don’t know the slide name Or want to change the slide names in Impress, right-click the slide thumbnail and click rename slide. OSlide = oSlideList.getByName("Slide1") ' Access by slide name oSlide = oSlideList.getByIndex(0) ' Access by Index You can also access the slide using the name as well. The first slide can be accessed by index 0 and so on. Slides are numbered from 0 to the number of slides in the Impress document. Individual slides from the slide collection can be accessed by index or name. Syntax – getDrawPages com::sun::star::drawing::XDrawPages getDrawPages () Returns an indexed container with the service DrawPages.įor this demo, the code snippet which will collect both slides is below: oSlideList = oDoc.getDrawPages() This method returns a collection of the slides. To get the slides, we need getDrawPages() method. Once we have the Impress document object ready, we can now access the Slides in the document. It returns the object of the corresponding document type from where it is being executed. ThisComponent property represents the document that basic belongs to. This can be done using the ThisComponent property. First, we need to create an object for the Impress presentation file i.e.
