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. Advertising

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

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    505
    Stephen Witter
    May 18, 2004
  3. Stu
    Replies:
    2
    Views:
    7,425
  4. Sharon
    Replies:
    0
    Views:
    623
    Sharon
    Jul 27, 2005
  5. Matt
    Replies:
    3
    Views:
    536
    Tor Iver Wilhelmsen
    Sep 17, 2004
Loading...

Share This Page