I am splitting the powerpoint presentation into multiple slides at that time this rpc error is coming , i already googled but not able to understand the cause of the problem. please help...!! <pre lang="c#">private void splitpptintomultipleslide(string path) { string realfilename = Path.GetFileNameWithoutExtension(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); int j = ppt1.Slides.Count; x = 1; try { string path1 = @"D:\practice\"; // or whatever if (!Directory.Exists(path1)) { Directory.CreateDirectory(path1); for (int i = 1; i <= j; i++) { string s = i.ToString(); string fullpath = path1 + realfilename + s + ".ppt"; string fullpathofimage = path1 + realfilename + s + ".png"; while (x == i) { <big>ppt1.Slides[x].Export(fullpath, "ppt");</big> <big>ppt1.Slides[x].Export(fullpathofimage, "png", 320, 620); </big> x++; ppt.Add(fullpath); png.Add(fullpathofimage); } } } else { for (int i = 1; i <= j; i++) { string s = i.ToString(); string fullpath = path1 + realfilename + s + ".ppt"; string fullpathofimage = path1 + realfilename + s + ".png"; while (x == i) { <big>ppt1.Slides[x].Export(fullpath, "ppt"); </big> <big>ppt1.Slides[x].Export(fullpathofimage, "png", 320, 620);</big> x++; ppt.Add(fullpath); png.Add(fullpathofimage); } } } } finally { ppt1.Close(); pptapp.Quit(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)