开发者

How to delete data from a powerpoint slide using C# code

开发者 https://www.devze.com 2022-12-18 21:36 出处:网络
Can开发者_如何学编程 you please help me in writing a code to delete images from a particular slide in powerpoint using C#?If you have Visual studio 2008 choose PowerPoint add-in template.

Can开发者_如何学编程 you please help me in writing a code to delete images from a particular slide in powerpoint using C#?


If you have Visual studio 2008 choose PowerPoint add-in template.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号