Powerpoint在宏中改变音效音量

时间:2014-02-08 14:28:31

标签: powerpoint powerpoint-vba

有没有办法可以通过vba / powerpoint中的宏来改变音效对象的音量?甚至静音和取消静音都足以满足我的目的。

2 个答案:

答案 0 :(得分:0)

Dim oSh As Shape
Set oSh = ActiveWindow.Selection.ShapeRange(1)

With oSh.MediaFormat
    .Volume = 1     ' scale is 0 to 1
    .Muted = False  ' | True
End With

答案 1 :(得分:0)

一个非常丑陋的解决方法。我确信有更好的方法可以做到这一点,但这里是

Sub mute()
Dim gameSlide As Slide
Set gameSlide = ActivePresentation.Slides("Round Board")
gameSlide.Shapes("numSound 5").MediaFormat.StartPoint = gameSlide.Shapes("numSound 5").MediaFormat.Length - 1
End Sub

Sub unmute()
Dim gameSlide As Slide
Set gameSlide = ActivePresentation.Slides("Round Board")
gameSlide.Shapes("numSound 5").MediaFormat.StartPoint = 0
gameSlide.Shapes("numSound 5").MediaFormat.EndPoint = gameSlide.Shapes("numSound 5").MediaFormat.Length
End Sub