different sounds when transitioning fwd and backward in slideshow

G

gvm

I need a certain sound to play each time the ppt slide show transitions
forwards
from one slide to the following one and a different sound to play when I
transition
in reverse, ie from one slide to the previous slide.

I have used the add-in that makes PPT respond to events from
http://www.pptfaq.com/FAQ00004.htm and attempted to write a macro that will
run each time the slide transition occurs, determine whether the transition
was forward or revese, and play the appropriate sound accordingly.

I based my macro on Shyam Pillai's sub that reports the index number in
a message box after each slide transition. Use of the sub shows that the
variable "index" reports the correct slide number transitioning both forwards
and backwards. Since Nextslide runs before moving to the next slide and I
read that "SlideIndex" is the index of the next slide, I thought the test for
whether transition is forward or back is simply a comparison of Shyam's
"index" and "SlideIndex".

My macro follows and it seems to be full of errors. The first problem
however is that the subroutine loops on the first slide, ie the message box
pops up repeatedly and it is necessary to terminate ppt to get out of the
loop.

Can someone help me straighten it out please? TIA.. Greg

Sub Auto_NextSlide(Index As Long)
Dim CurrentSlide As Long
CurrentSlide = Index
MsgBox "Slide No:" & Index
If ActivePresentation.SlideShowWindow.View.Slide.SlideIndex >
CurrentSlide Then
' we moved forward
ActivePresentation.Slides(1).SlideShowTransition.SoundEffect _
.ImportFromFile "c:\program files\microsoft office\media\laser.wav"
Else
' we moved backward
ActivePresentation.Slides(1).SlideShowTransition.SoundEffect _
.ImportFromFile "c:\program files\microsoft office\media\type.wav"
End If
End Sub
 

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