Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
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

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
 
Share this answer
 
v2
Comments
tushar Vayangankar 2-Feb-13 0:34am    
what is Microsoft.Office.Interop
how it works
Sergey Alexandrovich Kryukov 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
Joezer BH 3-Feb-13 0:55am    
5+
Sergey Alexandrovich Kryukov 3-Feb-13 13:12pm    
Thank you, Edo.
—SA
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.
 
Share this answer
 

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