On the Internet, the method of generating a Word document using the ASP is a lot. The most common method is to use Word to generate .dot documents, then transfer macro in the .dot document, this method is good, but it is very complicated And you cannot loop the form.
In practical applications, I summed up a new way to generate a Word file. The generated Word file has header, page corner, and now take out an example of discussing.
achieve:
My solution, use Word XP (other versions have not been tried yet) to create a form, convert the Word table to an HTML document, and the HTML document is converted with ASP.
The header, the page corner solution, after the conversion of the Word header, the DOC documentation of the page is attached to the converted HTML file, there is a header, page corner file and picture, as long as the corresponding in the HTML file The location changes its path to the server path. After the user opens the Word file generated by the ASP, Word will automatically prompt for these files.
Look at the HTML text after the following Word conversion, I use ASP to simply control:
<% Response.contenttype = "Application / MSWORD"%> < ! - #include file = "inc / check_character.asp" -> <% response.buffer = falseresponse.expires = 0call Check_logout () CALL CHECK_STATE () CALL PRIVILEGE (6) Call Log_Action ("Access", "Sales Number Print", "Print Temporary Sales Number" & Request ("Temp_ID"), 1)%>%> >>>>>>>>
/ xml>