URL to Open Word with A Specific File

Discussion in 'ASP .Net' started by EoRaptor013, Jun 8, 2006.

  1. EoRaptor013

    EoRaptor013 Guest

    Couldn't figure out the search that would turn this answer up...

    Building a company intranet web site. Need a way to click on a link,
    button, whatever, on the web page and thereby launch Word or Excel with
    a passed DOC or XLS file. So, on a given page, there's a hotspot to
    click on that downloads a formatted DOC or XLS to the user's machine
    and launches the appropriate application.

    Interestingly, for me, somehow the web site was set up so that clicking
    on a "traditional" file link opens the document or XLS in the browser
    but not in the separate external application. Don't know what to do
    about that but that's a different problem (right?).

    Any ideas would be appreciated.

    Randy
     
    EoRaptor013, Jun 8, 2006
    #1
    1. Advertising

  2. EoRaptor013

    mnichols Guest

    Hi,

    You can't tell the browser how to react to content, so to some extent
    your hands are tied. You also can't tell the browser to launch an
    application. You can only really tell the browser what type of content
    you are sending.

    If you are writing bytes to the output stream then the following maybe
    of interest:

    Response.Clear();
    Response.ContentType = "application/msword";
    Response.AddHeader(("Content-Disposition","attachment;filename=whatever.doc"));
    Response.BinaryWrite(filedata);

    I find this usually presents the user with a file open or save to disk
    dialog. Open will usually result in the MS Office app. being opened with
    the doc.

    mnichols

    EoRaptor013 wrote:
    > Couldn't figure out the search that would turn this answer up...
    >
    > Building a company intranet web site. Need a way to click on a link,
    > button, whatever, on the web page and thereby launch Word or Excel with
    > a passed DOC or XLS file. So, on a given page, there's a hotspot to
    > click on that downloads a formatted DOC or XLS to the user's machine
    > and launches the appropriate application.
    >
    > Interestingly, for me, somehow the web site was set up so that clicking
    > on a "traditional" file link opens the document or XLS in the browser
    > but not in the separate external application. Don't know what to do
    > about that but that's a different problem (right?).
    >
    > Any ideas would be appreciated.
    >
    > Randy
    >
     
    mnichols, Jun 8, 2006
    #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. Franck
    Replies:
    1
    Views:
    4,919
  2. sebb
    Replies:
    2
    Views:
    333
    Miki Tebeka
    Jan 12, 2004
  3. waheed iqbal

    Open Specific URL from Windows Desktop

    waheed iqbal, Mar 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    312
    Matt Lacey
    Mar 2, 2007
  4. mews.microsoft.com
    Replies:
    0
    Views:
    251
    mews.microsoft.com
    Mar 2, 2005
  5. B.G.
    Replies:
    3
    Views:
    171
Loading...

Share This Page