word替换.asp

来自「办公自动化系统」· ASP 代码 · 共 24 行

ASP
24
字号
<%
set oWord=createobject("Word.Application")

Function GenerateDocument(sTags, sValues, sSource, sDest)
    Dim aTags, aValues, i
    oWord.Documents.Open sSource
    aTags = Split(sTags, ",")
    aValues = Split(sValues, ",")
    For i = 0 To UBound(aTags)
        oWord.ActiveDocument.Content.Find.Execute aTags(i), , True, , , , , , , aValues(i), 1
    Next
    oWord.ActiveDocument.SaveAs sDest
    oWord.ActiveDocument.Close
    oWord.Quit
    GenerateDocument = True
End Function


response.write "Reading from Word......"
'set	oword=server.createobject("amberword.templet")
'response.write oword.GenerateForm("c:\","a.doc")
response.write generatedocument("方案一,方案二","TEST1,TEST2","c:\a.doc","c:\test1.doc")
set oWord=nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?