Macro for number of the current Impress slide

Creating a macro - Writing a Script - Using the API

Re: Macro for number of the current Impress slide

Postby Charlie Young » Tue Mar 17, 2015 10:50 pm

There were a few more problems with the variables, and also, in the Open statement, it makes no sense to use Mode Output and Access Read Write, just skip the access and do

Code: Select all   Expand viewCollapse view
Open sFileName For Output As #n


You can open it for Input later if you want to read the value.

See if the attached work better when running main.

Edit: for others who may look at maxtmacro, note that it contains a bit of code specific to Max's system

Code: Select all   Expand viewCollapse view
Sub EV_slideTransitionStarted(oEv)
'Print "Transition Started"
'MsgBox("hello")


   Dim n As Integer
   Dim Slide As Integer
   Dim sFileName As String
   
   Slide = oController.getCurrentSlideIndex
   
    sFileName = "/home/luivin/Desktop/macro/LastSlide.txt"
   
    n = FreeFile()
    Open sFileName For Output As #n
      Print #n,Slide
   close #n


End Sub
Attachments
maxtmacro.odp
(12.18 KiB) Downloaded 33 times
Last edited by Charlie Young on Wed Mar 18, 2015 2:24 pm, edited 1 time in total.
Apache OpenOffice 4.1.1
Windows XP
User avatar
Charlie Young
Volunteer
 
Posts: 1559
Joined: Fri May 14, 2010 1:07 am

Re: Macro for number of the current Impress slide

Postby RPG » Tue Mar 17, 2015 11:32 pm

Hello

I have test the first example of Charlie Young and it is working for me when I add a wait, as told.

Romke
LibreOffice 6.2.5.2 on openSUSE Leap 15
RPG
Volunteer
 
Posts: 2171
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Previous

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 8 guests