Open Word Doc in Word, not in Browser

Discussion in 'ASP .Net' started by Franck, Sep 9, 2005.

  1. Franck

    Franck Guest

    Hi,
    Tryin to open a generated word doc with Word and not in IE.

    Lookin samples, I tried this without success :

    Response.ContentType = "application/ms-word"
    Response.AddHeader("Content-Disposition", "inline;filename=" &
    MyFileName & ".doc")
    Response.WriteFile(MyFileVirtualPath)

    It's still opening my doc in the browser, not in Word.

    help please.
     
    Franck, Sep 9, 2005
    #1
    1. Advertisements

  2. Franck

    Mads Guest

    In the response.addheader, You just have to change 'inline' to
    'attachment':

    Response.AddHeader("Content-Disposition", "attachment;filename=" &
    MyFileName & ".doc")

    Mads


    Franck skrev:

    > Hi,
    > Tryin to open a generated word doc with Word and not in IE.
    >
    > Lookin samples, I tried this without success :
    >
    > Response.ContentType = "application/ms-word"
    > Response.AddHeader("Content-Disposition", "inline;filename=" &
    > MyFileName & ".doc")
    > Response.WriteFile(MyFileVirtualPath)
    >
    > It's still opening my doc in the browser, not in Word.
    >
    > help please.
     
    Mads, Sep 9, 2005
    #2
    1. Advertisements

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. John Wallace
    Replies:
    0
    Views:
    695
    John Wallace
    Jul 22, 2003
  2. vikram

    Cannot open Word doc using IE

    vikram, Mar 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    5,619
    Eric Lawrence [MSFT]
    Mar 5, 2004
  3. Stephen Witter

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    746
    Stephen Witter
    May 18, 2004
  4. Stu
    Replies:
    2
    Views:
    7,731
  5. Sharon
    Replies:
    0
    Views:
    816
    Sharon
    Jul 27, 2005
  6. Andrew
    Replies:
    1
    Views:
    5,813
    Andrew
    Oct 5, 2005
  7. Matt
    Replies:
    3
    Views:
    736
    Tor Iver Wilhelmsen
    Sep 17, 2004
  8. Replies:
    2
    Views:
    1,256
Loading...