Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
how to open office documents eg. .doc, .ppt files on web browser
I tried it but those file get downloaded
I dont want to download file just open it on web page
is there any api for that
Posted 1-Feb-13 18:11pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Just be logical: on a client side, the user can only see the site through the browser. In general case, the user don't have any software supporting office files, which are proprietary. These days, there are standards for those file formats, but it does not change the situation: the users' computers don't support them.
 
But, on server side, it depends. You can support them. But of course, forget "I don't want to download". Obvious, isn't it?
And you cannot present office files directly, by the reason I explained above. There is a number of sites which support office files. The presentation of the content should be simulated. Usually, with HTML.
 
[EDIT]
 
Tushar Vayangankar asked:
What is Microsoft.Office.Interop, how it works?
When you install Microsoft Office, among other things, you got primary Microsoft.Office.Interop assemblies installed in the GAC (Global Assembly Cache) of your local system. You can reference those assemblies and used them to, basically, create, open and modify Office Documents.
 
Also, these assemblies can be redistributed; see for example, http://www.microsoft.com/en-us/download/details.aspx?id=3508[^].
 
To reference the assemblies, as they are strongly named and installed in GAC, you need to reference them by names. So, in Visual Studio, you add a reference from the ".NET" tab of the "Add Reference" window. The assembly names are, Microsoft.Office.Interop.Word, Microsoft.Office.Interop.Excel, Microsoft.Office.Interop.PowerPoint, and so on. Each such assembly comes in different versions, depending of the versions of Office and .NET Framework installed.
 
Please see, for example:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.11%29.aspx[^],
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.aspx[^].
 
You will find such MSDN help pages on every Office product, separately.
 
In principle, there are 3rd-party products working with Office files, which would allow your to work without installation of Microsoft Office. If you are interested, I can advise the references, or you also can find them in available CodeProject answers.
 
—SA
  Permalink  
v2
Comments
tushar Vayangankar at 2-Feb-13 0:34am
   
what is Microsoft.Office.Interop
how it works
Sergey Alexandrovich Kryukov at 2-Feb-13 16:28pm
   
Please see my updated answer, after [EDIT].
If you agree that I reasonably answered your question, please accept it formally (green button) — thanks.
—SA
Edo Tzumer at 3-Feb-13 0:55am
   
5+
Sergey Alexandrovich Kryukov at 3-Feb-13 13:12pm
   
Thank you, Edo.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can't show a powerpoint document directly in a web browser natively. What you can do, however, is convert each slide of the powerpoint presentation to an image and then display the images as a slideshow on the client.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 480
1 Maciej Los 304
2 Richard MacCutchan 225
3 BillWoodruff 169
4 Suraj Sahoo | Coding Passion 155
0 OriginalGriff 8,759
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,269
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411028.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100