简体   繁体   English

如何使用C#代码从PowerPoint幻灯片中删除数据

[英]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.

相关问题 如何使用 c# 从 PowerPoint 中删除幻灯片? - How to delete slides from PowerPoint using c#? 如何使用C#保留PowerPoint幻灯片的textshape格式的格式 - How to preserve formatting of textshape format of powerpoint slide using c# 如何从C#中的PowerPoint幻灯片中读取复杂的方程式 - How to read complex equations from PowerPoint slide in C# 使用C#调用PowerPoint幻灯片 - calling powerpoint Slide using C# 如何从PowerPoint中的幻灯片中删除图表 - how to delete a chart from an slide in powerpoint 如何使用Microsoft Office Interop和C#从Powerpoint表中删除指定的行 - How to delete a specified row from a Powerpoint table using Microsoft Office Interop with C# 是否可以使用新数据(在C#中)更新PowerPoint幻灯片? - Is it possible to update a PowerPoint slide with new data (in C#)? 如何使用c#将MS PowerPoint中的默认声音添加到幻灯片中的形状 - How to add a default sound in MS PowerPoint to a shape in a slide using c# 如何使用C#VSTO读取presentationML并将输出放置在PowerPoint的活动幻灯片上 - How to read presentationML and place the output on Active slide of powerpoint using c# VSTO 如何使用互操作或打开 xml sdk c# 为幻灯片添加过渡到 powerpoint - how to add transition for slide to powerpoint using interop or open xml sdk c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM