在用asp编写程序的时候,有时候会用上,系统自动生成word文件,保存到本地,下面介绍具体方法。
asp生成word的代码如下:
<%
Dim fso, MyFile
strFilePath =server.mappath("/word/temp.doc")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(strFilePath, True)
MyFile.WriteLine("<table><tr><td>111111</td><td>222222</td></tr><tr><td>13212321</td><td>23123213</td></tr></table>")
MyFile.Close
Set fso = Nothing
%>