Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Previewing Office Documents - ASP.NET

Status
Not open for further replies.

vbkris

Programmer
Jan 20, 2003
5,994
IN
Hi,

My requirement is to show users a preview of Office documents (sitting on our server). I need to show a preview of the following:
- Word 2003 / 2007
- Excel 2003 / 2007
- PPT 2003 / 2007

The preview must be in such a way that the end users need not have office installed in their systems, but at the same time the formatting has to be maintained. End users will assuredly use only IE 6.x +.

The solution that i have identified currently is to open Word / Excel / PPT objects using interop. i invoke the "SaveAs" method and save these docs to MHT format. My end users will always see these MHT files which are basically HTML files (hopefully).

However i am currently using office 2003 objects. Therefore a challenge now arises while opening 2007 docs. On the net i found a lot of links for a compatiblity pack (using 2003 objects to work with 2007 objects).

However before exploring that i need to know if i can use 2007 objects (like 2003 objects) to open both 2007 and 2003 formats and invoke a "SaveAs" on those objects. Would also like to know where i can download 2007 assemblies.

Currently i am using .NET 2.0. Much of the code i saw for working with 2007 docs revolved around .NET 3.0 (using the System.IO.Packaging namespace).

Putting it short i would like to know:
-> The best approach for this (use 2003 objects or 2007 objects?)
-> Where can i download 2007 assemblies (similar to 2003 assemblies) and sample code snaps.

Krishnan

PS: Please do let me know if this is the wrong forum for this.

Known is handfull, Unknown is worldfull
 
i glanced over the forums here and there do not seem to be any that focus around MS Office API. that said a language specific forum my have a more diverse group of developers. vb or c#.

.net 3.0 is an extension of .net 2.0 so you should be able to use the 3.0 libraries without any issues (provided they are installed). I don't think you can download just the office assemblies api. My understanding was you needed to install the office suite. Maybe the SDK provides just the API. If you have an MSDN subscription you can download it from MS. This would be for development only. you would still need to purcahse the API for production.

the only impact on the asp.net framework is the content type you stream to the browser. until then asp.net isn't a factor. your just exporting an office document to another format.

another option: use Adobe Acrobat to convert to document to PDF and stream the PDF to the user.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
hey jason,

acrobat is not an open option (these guys are not even agreeing to have word on their systems when they view it, acrobat will be out of scope).

>>.net 3.0 is an extension of .net 2.0 so you should be able to use the 3.0 libraries without any issues (provided they are installed).

no go there too, have already asked.


>>the only impact on the asp.net framework is the content type you stream to the browser. until then asp.net isn't a factor. your just exporting an office document to another format.

correct. but i just wanted to get the approach also validated (running microsoft activex objects on a web server :D).

i guess i am completely stuck now :(. Think will have to raise a microsoft ticket for this...

Known is handfull, Unknown is worldfull
 
good luck with this requirement;)

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top