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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to open a windows spreadsheet

Status
Not open for further replies.

pabby

IS-IT--Management
Jan 5, 2004
47
GB
HI

I have been using response.redirect to go to other pages. This time I want to open a xls file that resides on a server\share.

What code is referenced from the click event of a button to open a file whether it be xls,doc, etc etc .

thanks,

Paul
 
Try using the example I gave in thread855-1144992


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I think it would be a lot easier to just let the client download it (which gives the "Open" option that saves it to the temp directory). But if you really don't want them to have to download a file, (don't quote me on this) I think you might have to read the file and use response.write to write everything you read back to the user, using a StringWriter and StringReader from the System.IO namespace. When writing you'll probly want to check out the Response.ContentType method. This is essentially doing the same thing as offering the option to download though.
 
which gives the "Open" option that saves it to the temp directory
That depends on the users settings as they can change whether they get this prompt or not. Changing the ContentType, like in my example, will in most cases prompt the user to save or open the file.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top