Helpful Information
 
 
Category: Web Design
opening html file in MS word via Web Browser

I know that if you have a reference to a .doc file in your html code, for example:
<a href="anyfile.doc">file</a>,
a web browser will allow the person to choose if he wants to save the document or open it in MS word. If the person chooses to open it, the browser calls word and opens the file in it. Can I get the web browser to do the same with a .html file?
Thanks for any feedback.

Jane,

The only reason that word open with a .doc href, is that it is set that way with the machines mime type body part.

I would imagine that you'd want your web browser to treat .html files *as* to opened in a browser.

I suppose you could change your mime type setting in the registry, but then all .html files would open in word, rendering the browser a bit pointless.

If you sent the document to a browser with a mime header so bizzare it didn't understand it, then the browser may default to 'save as'/'open as' mode.

Why do you want to do this?



------------------
-----------------
> James <
> james@xch.net <
-----------------

James,

What the customer wanted was a button to push to generate a FORMATTED word document. The problem was that this was the result of a search, and we wanted a dynamic result, thus the ".html " extension.

We ended up writing RTF to an html file so we could manipulate the format. You were right about how to get it to open in word, I just changed the content-type in the header of the file to "application/rtf" so the browser would prompt with the 'save as'/'open as'.

Thanks for your help,
Jane










privacy (GDPR)