Trn QuangHiu

Trn QuangHiu

  • NA
  • 15
  • 2.7k

How to add a sound to a shape in PowerPoint using c#

Apr 1 2017 1:54 AM
Here is my code:
I create a shape in a slide powerpoint. 
  1. Microsoft.Office.Interop.PowerPoint.Shape rectangle = curSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRoundedRectangle, slideWidth - 110, slideHeight - 60, 100, 50);  
  2.     Sequence objSequence = curSlide.TimeLine.InteractiveSequences.Add(1);  
  3.     Effect pEffect_start = objSequence.AddEffect(rectangle, MsoAnimEffect.msoAnimEffectTransparency, MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType.msoAnimTriggerOnShapeClick, 1);  
I can add an animation to shape, but with a sound I can not.
I want add a sound in this shape, when animation run so the sound is play. 
How can I do that?

Answers (1)