OpenFileDialog opObject = new OpenFileDialog(); opObject.Filter = "Office Documents(*.doc,*.xls,*.pptx)|*.doc;*.xls;*.pptx"; if (opObject.ShowDialog() == DialogResult.OK) { string path = opObject.FileName; //string pth = Path.GetFileName(path); //int num = RetrieveNumberOfSlides(path); Microsoft.Office.Interop.PowerPoint.Application pptapp = new Microsoft.Office.Interop.PowerPoint.Application(); Microsoft.Office.Interop.PowerPoint.Presentation ppt1 = pptapp.Presentations.Open(path, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse); string filename = @"D:\PPT"; int num = ppt1.Slides.Count; for (int i = 1; i <=num; i++) { string s = i.ToString(); string fullpath = filename + s +"ppt"; ppt1.Slides[i].Export(fullpath,"ppt"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)