2
votes

I am developing a VSTO add-in for Powerpoint which will automatically insert an audio and save the Powerpoint as Video.

I am able to succesfully insert audio file into the slide, but now i want to set its Playback property "Hide during Show" to true and "Start with Previous".

I have inserted the audio file using the following code,

 Microsoft.Office.Interop.PowerPoint.Slide currSlide = Globals.ThisAddIn.Application.ActiveWindow.View.Slide;
 var sh = currSlide.Shapes.AddMediaObject2("d:\\media\\temp.wav", MsoTriState.msoFalse, MsoTriState.msoTrue);

enter image description here

1

1 Answers

3
votes

In VBA, you'd do this with your sh object:

sh.AnimationSettings.PlaySettings.PlayOnEntry = True

Easiest way to make the shape "disappear" is to set its .Left property to a few points greater than ActivePresentation.PageSetup.SlideWidth. That'll put it slightly off the slide, so it won't appear during a slide show.