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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert web page to Word

Status
Not open for further replies.

cyberprof

Programmer
Jun 10, 2003
229
GB
I have a web page which produces a report. The report is just text and a table.

Is there any easy-ish way off adding a way of converting the report/web page into a Microsoft Word document.

Cheers

J
 
I found one that I use for excel export, I tried it for word for giggles and it works.

Make a link to an identical page how you want the information formatted.

(a href="default.asp?currentpage=inventory+control&page=inventory.vendordoc")EXPORT TO Word</a>

Then at the top of the next page before any other code above the table, put this;

<%
Response.ContentType = "application/vnd.ms-word"

%>

 
This sort of works. However, when you click the 'Export to Word' link, the save as dialog box asks for the file to be saved as an .asp file. If I manually save as a .doc file it works ok.

I am wanting to make this idiot proof for others to use. Is it possible for the save as dialog box default to .doc

Cheers

J
 
'Tells the browser to open word
Response.ContentType = "application/vnd.ms-word"
' Adds a header to give the document a name
response.AddHeader "content-disposition", "inline; filename=whateveryouwant.doc"

that should be a little easier :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top