Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the code to change content type?

Status
Not open for further replies.

OceanDesigner

Programmer
Joined
Oct 30, 2003
Messages
173
Location
US
I just need to change the content type to ms-Word (I want the web page to open in the Word applet), but I cannot find the syntax anywhere. In the simple code below, how do I implement the change in content type to Word?
Thanks, Jeff

Code:
<html>
<head>
<title>Word Document</title>
</head>
<body>
<p> Please open in MS Word </p>
</body>
</html>
 
If you make a regular link to .doc document, and client's browser (most Windows-based browsers) recognizes the format, it will open in MS Word. If you would like HTML document to open in Word, that cannot be done with HTML, because as soon as html page is server (ie when client reads the first <html> tag) headers have already been sent. This is controlled by the server. I suppose you could instruct the server to treat .html files with content type that will make them open in word, but that would apply to all .html pages.
 
Why not just rename the HTML file to have a .DOC extension? If it has styles, it probably won't render correctly in MSWord, but if it doesn't, you might get a roughly correct rendering.

Mike Krausnick
Dublin, California
 
Sounds like this is really an ASP function. I will take it up with the ASP forum. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top