|
iWebOffice2004调用VBA脚本解释及翻译(27) }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 webform.WebOffice.WebSetMsgByName("COMMAND","WordTABLE"); //OfficeServer.ASP COMMAND=WordTABLE //发送到服务器上 webform.WebOffice.WebSendMessage(); //OfficeServer.ASP OPTION=SENDMESSAGE //如果没有错误 if (webform.WebOffice.Error==""){ //取得列 iColumns = webform.WebOffice.WebGetMsgByName("COLUMNS"); //取得行 iCells = webform.WebOffice.WebGetMsgByName("CELLS"); //生成表格 iTable=webform.WebOffice.ActiveDocument.Tables.Add(webform.WebOffice.ActiveDocument.Application.Selection.Range,iCells,iColumns); for (var i=1; i<=iColumns; i++)
|