Let ASP generate a word file with styles. For example, the font color is red, bold, and the font size is 36. The copy code is as follows:
<%
Set fso=Server.CreateObject(Scripting.FileSystemObject)
str=<html><title>Example of asp generating word file</title><body><span style='color:#ff0000;font-size:36px; font-weight:bold;'>Welcome to www.vevb. com (script home)</span></body></html>
filename=2008.doc
Set act = fso.CreateTextFile(server.mappath(filename), true)
act.WriteLine(str)
act.close
Set fso=Nothing
response.write generated Word file successfully
%>