Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > URL to Open Word with A Specific File

Reply
Thread Tools

URL to Open Word with A Specific File

 
 
EoRaptor013
Guest
Posts: n/a
 
      06-08-2006
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

 
Reply With Quote
 
 
 
 
mnichols
Guest
Posts: n/a
 
      06-08-2006
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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Specific URL from Windows Desktop waheed iqbal ASP .Net 1 03-02-2007 09:53 AM
Request.URL.LocalPath shows incorrect Url.LocalPath/SCRIPT_NAME in specific cases mews.microsoft.com ASP General 0 03-02-2005 02:29 PM
Open Word Perfect File in MSFT Word??? WeeWilly Computer Support 2 01-04-2004 01:33 AM
Link to open a frameset page to a specific url in a frame? B.G. Javascript 3 12-30-2003 06:55 PM
How do you make sure a frameset is loaded? I'm trying to open a frameset in a new window which shows a specific html page in a specific frame ck388 Javascript 1 09-24-2003 08:32 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57