SOLVED

Countdown slide in Slide show

%3CLINGO-SUB%20id%3D%22lingo-sub-2732648%22%20slang%3D%22en-US%22%3ECountdown%20slide%20in%20Slide%20show%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2732648%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20PPSM%20file%20that%20I%20am%20running%20on%20a%20kiosk%20computer%2024%2F7.%26nbsp%3B%20There%20is%20one%20slide%20that%20I%20am%20counting%20down%20to%20a%20future%20date%20and%20I%20am%20trying%20to%20get%20it%20to%20update%20automatically%20and%20not%20having%20much%20luck.%26nbsp%3B%20I%20was%20wondering%20if%20anyone%20had%20any%20advice%20on%20how%20to%20get%20this%20work%20so%20that%20I%20do%20not%20have%20to%20go%20in%20everyday%20to%20update%20one%20slide.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20this%20code%20to%20%22trigger%22%20the%20slide%20update%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EPublic%20Sub%20OnSlideShowPageChange(ByVal%20Wn%20As%20SlideShowWindow)%0A%20%20%20If%20Wn.View.CurrentShowPosition%20%3D%201%20Then%0A%20%20%20%20%20%20%20Countdown%0A%20%20%20End%20If%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eand%20then%20this%20is%20what%20I%20am%20using%20to%20update%20the%20slide%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3ESub%20Countdown()%0A%0A%20%20%20%20Dim%20Days%20As%20Date%0A%20%20%20%20'Launch%20date%0A%20%20%20%20Days%20%3D%20DateSerial(2022%2C%202%2C%2014)%0A%0A%20%20%20%20ActivePresentation.Slides(1).Shapes(%22countdown%22).TextFrame.TextRange%20%3D%20%22Countdown%20to%22%20%26amp%3B%20vbCrLf%20%26amp%3B%20%22Valentines%20%22%20%26amp%3B%20vbCrLf%20%26amp%3B%20DateDiff(%22d%22%2C%20Now()%2C%20Days)%20%26amp%3B%20%22%20Days%22%0A%20%20%20%20%20%20%20%20ActivePresentation.Slides(1).Shapes(%22countdown%22)%20_%0A%20%20%20%20%20%20%20%20.TextFrame.TextRange.Characters(14%2C%202).Font.Name%20%3D%20%22Nobel-Bold%22%0A%20%20%20%20%20%20%20%20ActivePresentation.Slides(1).Shapes(%22countdown%22)%20_%0A%20%20%20%20%20%20%20%20.TextFrame.TextRange.Characters(25%2C%208).Font.Size%20%3D%20120%0A%20%20%20%20%20%20%20%20ActivePresentation.Saved%20%3D%20True%0A%20%20%20%20%20%20%20%20%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EAny%20advice%20would%20be%20appreciated.%26nbsp%3B%20Thank%20you!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I have a PPSM file that I am running on a kiosk computer 24/7.  There is one slide that I am counting down to a future date and I am trying to get it to update automatically and not having much luck.  I was wondering if anyone had any advice on how to get this work so that I do not have to go in everyday to update one slide.

 

I am using this code to "trigger" the slide update:

Public Sub OnSlideShowPageChange(ByVal Wn As SlideShowWindow)
   If Wn.View.CurrentShowPosition = 1 Then
       Countdown
   End If
End Sub

and then this is what I am using to update the slide:

Sub Countdown()

    Dim Days As Date
    'Launch date
    Days = DateSerial(2022, 2, 14)

    ActivePresentation.Slides(1).Shapes("countdown").TextFrame.TextRange = "Countdown to" & vbCrLf & "Valentines " & vbCrLf & DateDiff("d", Now(), Days) & " Days"
        ActivePresentation.Slides(1).Shapes("countdown") _
        .TextFrame.TextRange.Characters(14, 2).Font.Name = "Nobel-Bold"
        ActivePresentation.Slides(1).Shapes("countdown") _
        .TextFrame.TextRange.Characters(25, 8).Font.Size = 120
        ActivePresentation.Saved = True
        
End Sub

Any advice would be appreciated.  Thank you!!

 

1 Reply
best response confirmed by Opal55 (New Contributor)
Solution

I have changed the "trigger" to the following on the slide that plays just before the slide I want to update:

Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
   Dim Showpos As Integer
   Showpos = Wn.View.CurrentShowPosition + 1
        If Showpos = 1 Then
            Countdown
                End If
End Sub

This appears to be working.  If I get any errors, I will post back to this thread.  I still welcome any advice.  Thank you.