URL to Open Word with A Specific File

E

EoRaptor013

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
 
M

mnichols

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top