iWebOffice2004调用VBA脚本解释及翻译[10]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 csdnhome 的 blog

        if (webform.weboffice.filetype==".xls"){
     webform.weboffice.activedocument.activesheet.pictures.insert(mfilepath+vimgname).select();
   mimgshape =webform.weboffice.activedocument.application.selection.shaperange;
          mimgshape.pictureformat.transparentbackground = vtrans;
          mimgshape.pictureformat.transparencycolor = 16777215;
          mimgshape.fill.visible = false;
          mimgshape.zorder(vzorder);
        }
      } 
      //清除文件
      webform.weboffice.webmsgfileclear(mfilepath+vimgname);
    }
    statusmsg(webform.weboffice.status+webform.weboffice.error);
}

//套用模版定稿
function webinsertfile()
{
  //var mdialogurl = "version/versionlist.asp?recordid="+webform.weboffice.recordid;
  //var mobject = new object();
  //    mobject.fileid = "";
  //    mobject.result = false;
  //    window.showmodaldialog(mdialogurl, mobject, "dialogheight:280px; dialogwidth:420px;center:yes;scroll:no;status:no;");
  //if (mobject.result){
     //取得目录名称
     var mfilepath=webform.weboffice.webmsgfilepath;
     //取得文件类型
     var mfilename=webform.weboffice.recordid+webform.weboffice.filetype;
     var mbookrange;
     //保存当前文件
     webform.weboffice.save(mfilepath+mfilename,true);
     //如果没有问题
     if (webform.weboffice.error==""){
       //清除所有设置变量
       webform.weboffice.webmsgtextclear();
       //设置command为insertfile
       webform.weboffice.websetmsgbyname("command","insertfile");
       //设置需要调用的模版名称
       webform.weboffice.websetmsgbyname("tempname","模板一.doc");
       //发送该信息到服务器上
       webform.weboffice.websendmessage();
       //如果没有错误
       if (webform.weboffice.error==""){
         //关闭当前文件
         webform.weboffice.close();
         //保存模版文件
         webform.weboffice.webmsgfilesave(gfilename);
         //如果没有错误
         if (webform.weboffice.error==""){
            //打开模版文件
            webform.weboffice.open(gfilename,true);
            //查找需要插入的位置(标签)
            var mposition=webform.weboffice.webgetmsgbyname('position');
            if (mposition.length>0){
               mbookrange = webfindbookmarks(mposition);
            }else{
               mbookrange = webform.weboffice.activedocument.range.application.selection;
            }
            //将原工作文档插入到该位置
            mbookrange.insertfile(mfilepath+mfilename);
         } 
       }else{
         alert(webform.weboffice.error);
       }
     }
     //清楚文件
     webform.weboffice.webmsgfileclear(mfilepath+mfilename);
     statusmsg(webform.weboffice.status)
}

//作用:表格生成及填充
function websetwordtable(){
  var mtext="",mname="",icolumns,icells,itable;
  //清除所有设置变量
  webform.weboffice.webmsgtextclear();
  //设置command为wordtable

本文关键:Office VBA 痕迹保留 手写签名 电子印章
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top