[英]How to delete data from a powerpoint slide using C# code
您能帮助我编写代码以使用C#从PowerPoint中的特定幻灯片中删除图像吗?
If you have Visual studio 2008 choose PowerPoint add-in template. 如果您有Visual Studio 2008,请选择PowerPoint加载项模板。
public partial class ThisAddIn
{//this is the event of the startup of the powerpoint
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{//this is the event that will trigger when you select anything in you presentation
this.Application.WindowSelectionChange += new Microsoft.Office.Interop.PowerPoint.EApplication_WindowSelectionChangeEventHandler(Application_WindowSelectionChange);
}
void Application_WindowSelectionChange(Microsoft.Office.Interop.PowerPoint.Selection Sel)
{
//here you will delete the selected item
Sel.Delete();
}
but i recommend that you read more on the Microsoft add-in so you can achieve what you want exactly 但我建议您阅读有关Microsoft加载项的更多信息,以便您可以完全实现所需的功能
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.