Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

How do I open and edit a powerpoint file in asp.net using C#? I have to access a library and a be able to choose a specific file. I've tried other codes but when I click to open the file, it always prompts me to either open or save the file. Is there a way to skip the open and save part?
I just want the powerpoint file to open immediately without the open and save.
I've tried using "
System.Diagnostics.Process.Start("http://it3127:30091/Shared%20Documents/Test.ppsx");
"
But it prompts me for the open and save option.

I've also used this
Microsoft.Office.Interop.PowerPoint.Application pptApp = new Microsoft.Office.Interop.PowerPoint.Application();
                        Microsoft.Office.Core.MsoTriState ofalse = Microsoft.Office.Core.MsoTriState.msoFalse;
                        Microsoft.Office.Core.MsoTriState otrue = Microsoft.Office.Core.MsoTriState.msoTrue;
                        pptApp.Visible = otrue;
                        pptApp.Activate();
                        Microsoft.Office.Interop.PowerPoint.Presentations ps = pptApp.Presentations;
                        Microsoft.Office.Interop.PowerPoint.Presentation p = ps.Open(@"http://it3127:30091/Shared%20Documents/Forms/AllItems.aspx", ofalse, ofalse, otrue);
                        //System.Diagnostics.Debug.Print(p.Windows.Count.ToString());
                        MessageBox.Show(pptApp.ActiveWindow.Caption);
"
This code is able to open the powerpoint file immediately and allow me to edit, however, the slides are filled with
words or codes, ex "masterpagefile="~masterurl/default.master" Inherits="Microsoft.sharepoint.webpartpages.webpartpage,microsoft.sharepoint,version=14.0.0.0.0, culture=neutral,publickeytoken" and all these words carry on for 30 slides.

Would really really appreciate if there is another way or a solution to this.
Look forward to your replies.

Thankyou!
Posted
Comments
Sergey Alexandrovich Kryukov 9-Feb-14 21:40pm    
The question shows deep misunderstanding of how Web works. You will open a file on server side, now what?
—SA
Member 10498134 9-Feb-14 21:47pm    
Okay, the outlook form will retrieve all the documents that is in the sharepoint shared documents. So from the form, i'll click the powerpoint file, open it, and be able to edit it. Then checkout the file and the changes made to it would be saved into the sharepoint folder too. Currently i'm able to make it work for words doc.
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900