简体   繁体   English

WAV音频文件播放完毕后,VBA Powerpoint自动播放下一张幻灯片

[英]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? 有没有一种方法可以在VBA代码中插入音频文件,我将如何编写循环,以便在音频文件完成播放后直到幻灯片放映完成后,它可以使幻灯片前进? (ie "Advancing to next slide in 3....2....1...." [changes to next slide]) (即“前进到3..2 .... 1 ....中的下一张幻灯片” [更改到下一张幻灯片])

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. 在触发器(例如按下按钮或到达某个幻灯片)上,让VBA宏加载音频文件。
  2. Read the length of the audio file (in VBA). 读取音频文件的长度(在VBA中)。
  3. Play the file and wait the required amount of time (the length of the audio file) to progress to the next slide. 播放文件,然后等待所需的时间(音频文件的长度)以前进至下一张幻灯片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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