[英]How to add a default sound in MS PowerPoint to a shape in a slide using c#
Here is my code: 这是我的代码:
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);
I can add an animation to shape, but with a sound I can not. 我可以添加一个动画形状,但声音我不能。
I do not want to add file in a location: 我不想在一个位置添加文件:
rectangle.AnimationSettings.SoundEffect.ImportFromFile(fileLocation);
I want to add default sounds in Powerpoint: 我想在Powerpoint中添加默认声音:
How can I do that? 我怎样才能做到这一点?
let you try to add this line of code after yours 让你尝试在你的后面添加这行代码
pEffect_start.EffectInformation.PlaySettings.PlayOnEntry = Office.MsoTriState.msoCTrue;
The PlayOnEntry means the media is played/ not played on load event. PlayOnEntry表示在加载事件中播放/不播放媒体。 This property is supported even before MS Powerpoint 2007
甚至在MS Powerpoint 2007之前就支持此属性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.