script run with each new slide

R

Ralf Pabst

hi,

is it possible to hook a visual basic script into my powerpoint
presentation that is automatically run each time a new slide comes up?

if so, how? any help/hints/weblinks appreciated.

cheers,
ralf
 
J

JanAdam

Assuming it is to be run at a slide show, here is how you can do it:

1. in a module place the following code:

Option Explicit

Dim Name As New ClassWithEvents

Sub Init()
Set Name.SlideShow = Application
End Sub

2. in Class Modules insert ClassWithEvents and place the following code there:

Option Explicit
Public WithEvents SlideShow As Application

'main code, place your code into the following subroutine

Public Sub SlideShow_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
'just as an example:
MsgBox "hello"
End Sub

3. to run, before switching to the slide show, press Alt F8 and click OK to
run the “Init†subroutine
4. then select slide show and enjoy
 
R

Ralf Pabst

Thanks for the help and sorry for the late reply. I was off line for a
couple of days.

regards,
ralf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top