Reputation: 11
I want to add a different audio file to each slide for narration.
I can use the ribbon to insert an audio file for each slide. Manually doing it takes forever.
I can't locate in the VBA PowerPoint docs what object to work with.
When I search for audio, insert audio etc. I get nothing helpful from MS PowerPoint docs.
Upvotes: 1
Views: 234
Reputation: 3387
To add audio file, use AddMediaObject2
method under Shapes
object. (Documentation)
Example of adding an audio file to the first slide of your current presentation:
Application.ActivePresentation.Slides(1).Shapes.AddMediaObject2("Audio file path")
You can also set a variable to the Shape
returned by the method for further modification:
Dim newAudio As Shape
Set newAudio = Application.ActivePresentation.Slides(1).Shapes.AddMediaObject2("Audio file path")
Upvotes: 1