Page 2 of 2

Re: Macro for number of the current Impress slide

PostPosted: Tue Mar 17, 2015 10:50 pm
by Charlie Young
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

Re: Macro for number of the current Impress slide

PostPosted: Tue Mar 17, 2015 11:32 pm
by RPG
Hello

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

Romke