Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 03-26-2007, 11:53 AM ASP to word document
Skilled Talker

Posts: 95
Trades: 0
Hi.

I'm using the following code to create a word document from an ASP web page

<%Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "attachment;filename=Project_"&projectlookup&".doc "%>

This works great, can gives the option to save or open. But if after they have opend the file or even saved it then open. When they click the save button it defaults to HTML not .doc.

Ok the work around is to use save as for the first time. But is there any way of locking it into not defaulting .HTML after all it is a.Doc in the first place.
higginbt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-15-2007, 01:44 AM Re: ASP to word document
Novice Talker

Posts: 9
Trades: 0
Can you provide the complete senario, what and how do you need this age in .doc ?
__________________

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

jnssoft is offline
Reply With Quote
View Public Profile Visit jnssoft's homepage!
 
Old 04-15-2007, 03:54 AM Re: ASP to word document
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
I don't think it's going to be possible for a web server to change the default behavior of a client application on a visitor's computer. Even just for the one particular file you send down.

On the other hand, you could try making the file read only, which means people would have to use Save As instead of Save, which could be a gentle reminder. But that wouldn't change the file format it's going to want to use by default.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 04-15-2007, 11:22 AM Re: ASP to word document
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I haven't tried this with Word, but I have generated Excel spreadsheets on the fly before and I didn't change the filename. Maybe that's your problem.

Take out the second line and see what happens.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to ASP to word document
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63536 seconds with 12 queries