none
Delete text from presentation slide using C# RRS feed

  • Question

  • Hi.

    I  create new slide using c# and shift unnecessary TEXT from original slide to the new slide. i shifted TEXT successfully on the new slide but in an original slide i m fail to delete that TEXT to avoid repetition.

    how to i delete TEXT from original slide pro grammatically without using PowerPoint Add-in ??

    Thursday, September 25, 2014 9:28 AM

Answers

  • Hi Taimoor,

    >>how to i delete TEXT from original slide pro grammatically without using PowerPoint Add-in ??<<

    As far as I know, we use TextRange object to contain the text that's attached to a shape, and properties and methods for manipulating the text.

    If we want to remove the text, we need to know which shape it attached. Here is a sample to remove the text from first shape on the first slide for your reference:

     string fileName = @"C:\Users\UserName\Desktop\Hello.pptx";
                Application pptApp = new Application();
                pptApp.Visible = MsoTriState.msoCTrue;
                Presentation pptDoc= pptApp.Presentations.Open(fileName);
                pptDoc.Slides[1].Shapes[1].TextFrame.TextRange.Text = "";

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 26, 2014 8:04 AM
    Moderator

All replies