How do i extract text from notes and comments in a pptx file?

Hi,

How do i extract text from slides, notes and comments in a pptx file?
Please provide me the code snippet C#.

Regards,
Karthik

Hi Karthik,

Please find attached the pptx file. From this file, you can extract slide text and notes text using the following C# code.

PresentationEx pres = new PresentationEx("d:\\ppt\\aa.pptx");

SlideEx sld= pres.GetSlideById(256);

ShapesEx shps= sld.Shapes;

for (int i = 0; i <= shps.Count - 1;i++ )

{

if ((sld.Shapes[i]) is AutoShapeEx)

{

AutoShapeEx shp = (AutoShapeEx)sld.Shapes[i];

TextFrameEx txt = shp.TextFrame;

Response.Write(txt.Text);

}

}

NotesSlideEx note= sld.NotesSlide ;

AutoShapeEx shp1 = (AutoShapeEx)note.Shapes[1];

TextFrameEx txt1 = shp1.TextFrame;

Response.Write(txt1.Text);