By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,739 Members | 1,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,739 IT Pros & Developers. It's quick & easy.

Word mime type and input buttons

P: n/a

I have a few input buttons at the end of an asp page. When I change the
mime-type of the asp page to create a Word Document which the user can
save, the input buttons are not displayed.
Is there a way to display the buttons AND have the mime type set to
vnd.ms-word on the same page?

<% @ Language=VBScript %>
<%
Response.ContentType = "Application/vnd.ms-word"
Response.AddHeader "content-disposition",
"attatchment;filename=Report.doc"

'Connect to db and retrieve data...
%>
<html>
<head>
<script language="JavaScript">
function SaveAs() {
document.execCommand('SaveAs',1,'Report.doc');
}
</script>
</head>
<body>
<%
'Create report using data retrieved from database
'At the end of the report display a Save, Edit and print button:
%>
<input type="button" name="btnSave" value="Save" onClick="SaveAs()">
<input type="button" name="btnEdit" value="Edit"
onClick="javascript:history.go(-1)">
<input type="button" name="btnPrint" value="Print"
onClick="window.print()">
</body>
</html>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Luis wrote on 16 aug 2004 in microsoft.public.inetserver.asp.general:

I have a few input buttons at the end of an asp page. When I change the
mime-type of the asp page to create a Word Document which the user can
save, the input buttons are not displayed.
Is there a way to display the buttons AND have the mime type set to
vnd.ms-word on the same page?
You would have to find out the word code for buttons, as this is not
displayed as a browser html page. Perhaps there are MSword NGs that know
the answer.
<%
Response.ContentType = "Application/vnd.ms-word"
Response.AddHeader "content-disposition",
"attatchment;filename=Report.doc"


"attatchment" this will give an error, I suppose: Loose a "t".

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.