zoukankan      html  css  js  c++  java
  • 用ASP实现超长内容的word模板替换objDoc.Content.Find.Execute

    内部系统生成DOC报表时,会因为数据内容过长而出错,做了一下修正,实现超长内容的WORD模板下的替换。

    Sub WordReplace(objDoc,strFind,strReplace)
     Dim i,strContent
    if isnull(strReplace) then
     objDoc.Content.Find.Execute strFind, , True, , , , , , , "", 2
    else
     if len(strReplace)<=200 then
      objDoc.Content.Find.Execute strFind, , True, , , , , , , strReplace, 2
     else
      i=0
      do while i*200<len(strReplace)
       strContent=mid(strReplace,i*200+1,200)+strFind
       objDoc.Content.Find.Execute strFind, , True, , , , , , , strContent, 2
       i=i+1
      loop
      objDoc.Content.Find.Execute strFind, , True, , , , , , , "", 2
     end if
    end if
    end sub

  • 相关阅读:
    测试工作——XML
    js call apply
    JavaScript 作用域和作用域链
    hybird app
    正则表达式
    浏览器渲染原理
    head 头标签(转发)
    参考资料地址
    unix 常用命令
    phantomjs 自动化测试
  • 原文地址:https://www.cnblogs.com/gpwzw/p/12147484.html
Copyright © 2011-2022 走看看