How to open a remote ppt file by Microsoft.Office.Interop.PowerPoint?
-
2011年12月2日 5:38
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 = @"\\192.168.31.164\isoftShare\123.ppt"; objPres = objPresSet.Open(strPath, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoFalse); objSlides = objPres.Slides; //Run the Slide objSSS = objPres.SlideShowSettings; objSSS.Run(); //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 "\\192.168.31.164\share\123.ppt" When I run my application COMException (0x80004005): PowerPoint could not open the file.if i open the "\\192.168.31.164\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
jakeyjia
全部回复
-
2011年12月2日 18:22版主
Hi jakeyjia,The purpose of this forum is to support the Open Specifications documentation. You can read about the Microsoft Open Specifications program here, http://www.microsoft.com/openspecifications/en/us/default.aspx
The library of Open Specification documents is located here, http://msdn.microsoft.com/en-us/library/dd208104(PROT.10).aspxYour question may be more applicable to this forum, http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads
Regards,
Vilmos Foltenyi - MSFT- 已标记为答案 Vilmos Foltenyi MSFTMicrosoft Employee, Moderator 2011年12月2日 18:22

