How to open a remote ppt file by Microsoft.Office.Interop.PowerPoint? RRS feed

  • Question

  • Hi all

    I want to run a ppt file using c#, 32 bit Os,  windows 7. 

    Part of the code is as follows:

                //Create a new presentation based on a template.
                objApp = new PowerPoint.Application();
                objApp.Visible = MsoTriState.msoTrue;
                objPresSet = objApp.Presentations;
                string strPath = @"\\\isoftShare\123.ppt";
                objPres = objPresSet.Open(strPath, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoFalse);
                objSlides = objPres.Slides;
                //Run the Slide
                objSSS = objPres.SlideShowSettings;
                //Wait for the slide show to end.
                objSSWs = objApp.SlideShowWindows;
                while (objSSWs.Count >= 1) System.Threading.Thread.Sleep(100);

    Here if the ppt file path (strPath) is the local file like "C:\123.ppt" then is no problem, but if the file path is a network path like "\\\share\123.ppt" When I run my application COMException (0x80004005): PowerPoint could not open the file.

    if i open the "\\\share\123.ppt" file manually by the Office PowerPoint 2007, it also work. but why use C# can't?

    I did a lot of googling but problem could not be resolved.

    Please help

    Friday, December 2, 2011 5:38 AM