通过 VBA 将音频剪辑添加到跨越多张幻灯片的 PowerPoint 演示文稿 [英] Add audio clip via VBA to PowerPoint Presentation that spans multiple slides

查看:56
本文介绍了通过 VBA 将音频剪辑添加到跨越多张幻灯片的 PowerPoint 演示文稿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要在演示文稿中的多张幻灯片中播放作为形状插入的音频剪辑,效果 选项卡中的播放声音 对话框中有一个名为 的选项停止播放,这可以设置为在__幻灯片之后.

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.

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

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?

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

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

推荐答案

试试这个:

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

这篇关于通过 VBA 将音频剪辑添加到跨越多张幻灯片的 PowerPoint 演示文稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆