VBA events in Powerpoint

Asked

Viewed 614 times

2

Hello,

Is there any event in Powerpoint that allows the execution of a subroutine when selecting a slide.

For example, the presentation is running... When you get to slide 120 it has to run a routine or macro without any user action or button.

I looked for something like: slide120_Open() and slide120_Iniciallize() but did not succeed in either.

1 answer

2


Event

To trigger some programming when the Powerpoint Slide reaches/reaches a particular page during the presentation, the event OnSlideShowPageChange can be used.

The code will be called before entering Slide, during the transition.

For example, the code will be called on Slide 3: Slide 2 -> Transição -> Slide 3.

Code

Public Sub OnSlideShowPageChange(ByVal Wn As SlideShowWindow)
   'O Slide 3 é selecionado
   If Wn.View.CurrentShowPosition = 3 Then
       'Créditos https://stackoverflow.com/a/3205576/7690982
       'Inserir o código aqui.
       MsgBox "Teste: O código foi acionado."
   EndIf
End Sub

Browser other questions tagged

You are not signed in. Login or sign up in order to post.