简体   繁体   English

如何使用c#将MS PowerPoint中的默认声音添加到幻灯片中的形状

[英]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中添加默认声音:

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.

相关问题 通过插座 C# 远程 MS PowerPoint 幻灯片 - Remote MS PowerPoint slide by socket C# 如何使用OpenXML在powerpoint幻灯片中插入形状 - How to insert a shape in a powerpoint slide using OpenXML 如何使用互操作或打开 xml sdk c# 为幻灯片添加过渡到 powerpoint - how to add transition for slide to powerpoint using interop or open xml sdk c# 如何使用C#保留PowerPoint幻灯片的textshape格式的格式 - How to preserve formatting of textshape format of powerpoint slide using c# 如何使用C#代码从PowerPoint幻灯片中删除数据 - How to delete data from a powerpoint slide using C# code 使用C#调用PowerPoint幻灯片 - calling powerpoint Slide using C# C# WindowsForm 将 DatagridView 内容添加到 PowerPoint 的幻灯片中 - C# WindowsForm Add DatagridView Content into PowerPoint's slide 如何更改PowerPoint的c#加载项中显示的当前幻灯片 - how to change current slide shown from c# Add-in for PowerPoint 如何在 PowerPoint VSTO c# 加载项中创建 function 加载项,它将当前幻灯片更改为下一张幻灯片,我该如何测试它? - how to create a function in PowerPoint VSTO c# Add-in which will change the current slide to the next slide and how can I test it? 在 c# VSTO 中的 powerpoint 图表上添加形状 - Add shape over powerpoint chart in c# VSTO
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM