tags:

views:

214

answers:

2

Can you please help me in writing a code to delete images from a particular slide in powerpoint using C#

A: 

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

Bass
This code works when you select anything from ppt . But i want to delete slides based on the slide name or slide number
Himaja
That's not what you asked, you wanted "a code to delete images from a particular slide" .
Bass
A: 

How do I remove some slides from a power point presentation?

rose