[英]How to add a default sound in MS PowerPoint to a shape in a slide using c#
這是我的代碼:
Microsoft.Office.Interop.PowerPoint.Shape rectangle = curSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRoundedRectangle, slideWidth - 110, slideHeight - 60, 100, 50);
Sequence objSequence = curSlide.TimeLine.InteractiveSequences.Add(1);
Effect pEffect_start = objSequence.AddEffect(rectangle, MsoAnimEffect.msoAnimEffectTransparency, MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType.msoAnimTriggerOnShapeClick, 1);
我可以添加一個動畫形狀,但聲音我不能。
我不想在一個位置添加文件:
rectangle.AnimationSettings.SoundEffect.ImportFromFile(fileLocation);
我想在Powerpoint中添加默認聲音:
我怎樣才能做到這一點?
讓你嘗試在你的后面添加這行代碼
pEffect_start.EffectInformation.PlaySettings.PlayOnEntry = Office.MsoTriState.msoCTrue;
PlayOnEntry表示在加載事件中播放/不播放媒體。 甚至在MS Powerpoint 2007之前就支持此屬性
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.