讓ASP生成帶有樣式的Word文件,如字體顏色為紅色,加粗,字號為36號的文字,代碼如下:
< %
Set fso=Server.CreateObject("Scripting.FileSystemObject")
str="<html><title>asp生成Word文件舉例</title><body><span style='color:#ff0000;font-size:36px; font-weight:bold;'>歡迎光臨www.aspprogram.cn(ASP編程網)</span></body></Html>"
filename= "2008.doc"
Set act = fso.CreateTextFile(server.mappath(filename), true)
act.WriteLine(str)
act.close
Set fso=Nothing
response.write "生成Word文件成功"% >