简体   繁体   中英

VBA Powerpoint auto next slide after wav audio file finishes playing

Is there a way to insert an audio file in VBA code and how would I write the loop so that it advances the slide right after the audio file finishes playing until the slideshow is done? (ie "Advancing to next slide in 3....2....1...." [changes to next slide])

For example:

Sub AutoSlide()
while '(slideshownotover)
      'wait 8 seconds
      'play given audio wav file
      ActivePresentation.SlideShowWindow.View.Next 'do this after audio finishes
End Sub

This isn't enough information to really understand the scenario. However, one possible approach would be:

  1. On a trigger (such as pressing a button or reaching a certain slide), have a VBA macro load an audio file.
  2. Read the length of the audio file (in VBA).
  3. Play the file and wait the required amount of time (the length of the audio file) to progress to the next slide.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM