- ·上一篇文章:简单的asp操作access例子源码
- ·下一篇文章:asp汉字转换成汉语拼音代码
asp生成带有样式的word文件
让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文件成功"
% >
<
%
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文件成功"
% >
asp生成带有样式的word文件