国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP生成DOC(Word文件)的代碼

2024-05-04 11:06:48
字體:
供稿:網(wǎng)友
< %
const lie=3    '修改列數(shù)
const tablewidth="33%" '定義表格的寬度
const tableheight="18%" '定義表格的高度
const imgwidth="15%" '定義表格的寬度
const imgheight="27.5%" '定義表格的高度
const fontsize="12px;" '定義文字的大小
const txtwidth="120"    '圖片右側(cè)文字表格寬
const txtheight="18%"    '圖片右側(cè)文字表格高
const txtalign="left"    '圖片右側(cè)文字對齊方式:left左,center中,right右

'TOP 強調(diào)該文件為Word文件
function doctop()
    doctop="<html xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:o=""urn:schemas-microsoft-com:office:office"" xmlns:w=""urn:schemas-microsoft-com:office:word"" xmlns=""http://www.w3.org/TR/REC-html40""><head><title>生成結(jié)果</title><meta http-equiv=Content-Type content=""text/html; charset=gb2312""></meta><meta name=ProgId content=Word.Document></meta><meta name=Generator content=""Microsoft Word 10""></meta><meta name=Originator content=""Microsoft Word 10""><style type=""text/css"">@page Section1{margin:30pt 8.5pt 5.65pt 12pt;}div.Section1{page:Section1;}table{font-size:"&fontsize&"}</style></meta></head>"+chr(13)+chr(10)
end function

function imgtotable(fto,fpar,dext)
    imgtotable="<table width="&tablewidth&" height="&tableheight&" border=0>"
    imgtotable=imgtotable+"<tr valign=""top""><td><img src="""&replace(demo,fpar,"")&""" width="""&imgwidth&""" height="""&imgheight&"""/></td>"
    imgtotable=imgtotable+"<td colspan=""2"" align=""center"">"
    imgtotable=imgtotable+"<table width="&txtwidth&" height="&txtheight&"><tr><td align="""&txtalign&""">"&replace(lcase(fto.name),"."&dext,"")&"</td></tr><tr><td align="""&txtalign&""">演員</td></tr><tr><td align="""&txtalign&""">語言</td></tr><tr><td align="""&txtalign&""">容量</td></tr><tr><td align="""&txtalign&""">類型</td></tr></table>"
    imgtotable=imgtotable+"</td></tr></table>"+chr(13)+chr(10)
end function


function imagetodoc(fpath,fpar)
    set fto=fso.createtextfile(fpath&"/運行結(jié)果.doc",True)
    fto.writeline doctop()
    fto.writeline "<body topmargin=0 leftmargin=0><table width=""64"" height=""100%"" border=1><div class=Section1>"
    for each demo in fpath.files
        dext=Lcase(fso.getExtensionName(demo))
        if dext="jpg" or dext="gif" or dext="png" then
            if (i mod lie)=0 then fto.writeline "    <tr>"+chr(13)+chr(10)
            i=i+1
            fto.writeline "<td>"
            '用于排錯
            'fto.writeline "123"
            fto.writeline imgtotable(demo,fpar,dext)
            fto.writeline "</td>"+chr(13)+chr(10)
            if (i mod lie)=0 then i=0:fto.writeline "    </tr>"+chr(13)+chr(10)
        end if
    next
    fto.close
    response.write "</div></table></body>"
    response.write ""&fpo&fpath&"/運行結(jié)果.doc"" 生成完畢。<br />"
    set fto=nothing
end function

set fso=server.createobject("scripting.filesystemobject")
set fpo=fso.getfolder(server.mappath("./"))
for each demo in fpo.subfolders
    call imagetodoc(demo,"")
next
set fpo=nothing
set fso=nothing
%>
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 柞水县| 临高县| 浠水县| 乐安县| 夏邑县| 恩施市| 通城县| 兴海县| 于都县| 民权县| 台中市| 左云县| 洪江市| 保康县| 蕉岭县| 新化县| 东辽县| 集安市| 绥德县| 蒙山县| 铜鼓县| 酒泉市| 兴宁市| 紫云| 广元市| 沽源县| 桃源县| 澄迈县| 潼南县| 新竹市| 洛隆县| 资中县| 惠来县| 临泉县| 夏邑县| 额敏县| 溧阳市| 翁源县| 蓝山县| 禹州市| 綦江县|