}
//套用模版定稿
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
webform.WebOffice.WebSetMsgByName("COMMAND","WORDTABLE"); //OfficeServer.asp COMMAND=WORDTABLE
//发送到服务器上
webform.WebOffice.WebSendMessage(); //OfficeServer.asp OPTION=SENDMESSAGE
//如果没有错误
if (webform.WebOffice.Error==""){
//取得列
iColumns = web
form.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++)
{
for (var j=1; j<=iCells; j++)
{
mName=i.toString()+j.toString();
//取得表格内容
mText=webform.WebOffice.WebGetMsgByName(mName);
来源:upschool.cn
作者:
关键字:翻译
发表日期:2006-7-26
网页显示有限 阅读全文请下载本文完整版WORD文档
上一篇:Asp:base64编码、解码函数 下一篇:突破IIS的客户端连接限制
共13页
9 7 [
1] [
2] [
3] [
4] [
5] [
6] [
7] [
8] [
9] [
10] [
11] [
12] [
13]
8 :>
2009-1-9 1:53:15