通过 VBA 将音频剪辑添加到跨多张幻灯片的 PowerPoint 演示文稿

发布于 2024-11-28 15:43:55 字数 716 浏览 1 评论 0原文

要播放以形状形式插入演示文稿中多张幻灯片的音频剪辑,效果选项卡中的播放声音对话框中有一个名为停止播放< /strong> 并且可以将其设置为在 __ 张幻灯片之后

我浏览了对象模型,甚至尝试使用 ppt 2003 记录宏(该选项不记录)。如何(如果可以)通过VBA设置此选项?

Stop Playing After __ Slides option

我当前添加声音的方式(在幻灯片前进后停止)是:

Dim oSlide As Slide
Dim oShp As Shape
Dim oEffect As Effect

Set oSlide = ActivePresentation.Slides(2)

Set oShp = oSlide.Shapes.AddMediaObject("C:\MyAudioClip.wav", True, False, 10, 10)

Set oEffect = oSlide.TimeLine.MainSequence.AddEffect(oShp, msoAnimEffectMediaPlay, , msoAnimTriggerWithPrevious)
oEffect.MoveTo 1

To play an audio clip inserted as a shape across multiple slides in a presentation, there is an option in the Play Sound dialog in the Effect tab called Stop playing and this can be set to After __ slides.

I've browsed the object model and even attempted recording a macro using ppt 2003 (the option does not record). How (if it can) can this option be set via VBA?

Stop Playing After __ slides option

The way I'm currently adding a sound (that stops after the slides are advanced) is:

Dim oSlide As Slide
Dim oShp As Shape
Dim oEffect As Effect

Set oSlide = ActivePresentation.Slides(2)

Set oShp = oSlide.Shapes.AddMediaObject("C:\MyAudioClip.wav", True, False, 10, 10)

Set oEffect = oSlide.TimeLine.MainSequence.AddEffect(oShp, msoAnimEffectMediaPlay, , msoAnimTriggerWithPrevious)
oEffect.MoveTo 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦萦几度 2024-12-05 15:43:55

试试这个:

Dim oSlide As Slide
Dim oShp As Shape
Dim oEffect As Effect

Set oSlide = ActivePresentation.Slides(1)

Set oShp = oSlide.Shapes.AddMediaObject("p:\testfile\media\minivincent.wav", True, False, 10, 10)

With oShp.AnimationSettings.PlaySettings
    .PlayOnEntry = True
    .PauseAnimation = False
    .StopAfterSlides = 19
End With

Try this instead:

Dim oSlide As Slide
Dim oShp As Shape
Dim oEffect As Effect

Set oSlide = ActivePresentation.Slides(1)

Set oShp = oSlide.Shapes.AddMediaObject("p:\testfile\media\minivincent.wav", True, False, 10, 10)

With oShp.AnimationSettings.PlaySettings
    .PlayOnEntry = True
    .PauseAnimation = False
    .StopAfterSlides = 19
End With
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文