Word mime type and input buttons

Discussion in 'ASP General' started by Luis, Aug 16, 2004.

  1. Luis

    Luis Guest

    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!
    Luis, Aug 16, 2004
    #1
    1. Advertising

  2. Luis

    Evertjan. Guest

    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)
    Evertjan., Aug 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CJ
    Replies:
    1
    Views:
    1,562
    Andrew Thompson
    Oct 29, 2004
  2. Arthur Marinis via .NET 247

    Calling a webservice in Dotnet using HTTP-POST and input mime type

    Arthur Marinis via .NET 247, Aug 30, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    297
    Arthur Marinis via .NET 247
    Aug 30, 2004
  3. Jan Arickx
    Replies:
    0
    Views:
    191
    Jan Arickx
    Aug 25, 2003
  4. joe
    Replies:
    0
    Views:
    186
  5. ecureuil
    Replies:
    0
    Views:
    320
    ecureuil
    May 28, 2006
Loading...

Share This Page