L
Luis
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>
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>