问题
is there a way that i can change the volume of a sound effect object through vba/a macro in powerpoint? even mute and unmute would be sufficient for what I am trying to do.
回答1:
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
回答2:
a very ugly workaround. I am sure there is a better way of doing this, but here it is
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
来源:https://stackoverflow.com/questions/21647225/powerpoint-change-sound-effect-volume-in-macro