Class SoundEffect (PowerPoint VBA)

The class SoundEffect represents the sound effect that accompanies an animation or slide transition in a slide show. To use a SoundEffect class variable it first needs to be instantiated, for example


Dim set as SoundEffect
Set set = ActiveWindow.RangeFromPoint.AnimationSettings.SoundEffect

ImportFromFile

Specifies the sound that will be played whenever the specified shape is clicked or animated or whenever the specified slide transition occurs.

ImportFromFile (FileName)

Name

Returns or sets the name of the specified object.

You can use the object's name in conjunction with the Item method to return a reference to the object if the Item method for the collection that contains the object takes a Variant argument. For example, if the value of the Name property for a shape is Rectangle 2, .Shapes("Rectangle 2") returns a reference to that shape.


ActiveWindow.RangeFromPoint.AnimationSettings.SoundEffect.Name =

Play

Plays the specified sound effect.


ActivePresentation.Slides(2).Shapes(2).AnimationSettings.SoundEffect.Play

Type

Represents the type of sound effect. Possible return values are ppSoundEffectsMixed - Mixed, ppSoundFile - File, ppSoundNone - None, ppSoundStopPrevious - Stop Previous.

The value of the Type property can be one of these PpSoundEffectType constants.


ActiveWindow.RangeFromPoint.AnimationSettings.SoundEffect.Type = ppSoundEffectsMixed