break;
}
}
}
return (mBookObject);
}
//插入服务器图片
function WebInsertImage(vLabName,vImgName,vTrans,vZOrder)
{
//取得文件目录
var mFilePath=webform.WebOffice.WebMsgFilepath;
var mImgShape=null;
var mPassword=null;
//清除所有设置变量
webform.WebOffice.WebMsgTextClear();
//设置COMMAND 为 INSERTIMAGE 命令
webform.WebOffice.WebSetMsgByName("COMMAND","INSERTIMAGE");
//设置要插入的图片名称
webform.WebOffice.WebSetMsgByName("IMAGENAME",vImgName);
//发送到服务器上
webform.WebOffice.WebSendMessage();
//如果没有错误
if (webform.WebOffice.Error==""){
//将服务器返回的图片保存
webform.WebOffice.WebMsgFileSave(mFilePath+vImgName);
//如果没有错误
if (webform.WebOffice.Error==""){
//如果是word文档
if (webform.WebOffice.FileType==".doc"){
var mInlineShapes=null; //=webform.WebOffice.ActiveDocument.InlineShapes.Count;
//var mShapes=webform.WebOffice.ActiveDocument.Shapes.Count;
var mBookMark=WebFindBookmarks(vLabName);
if (mBookMark){
mInlineShares=mBookMark.InlineShapes.AddPicture(mFilePath+vImgName);
}else{
mInlineShares=webform.WebOffice.ActiveDocument.Application.Selection.InlineShapes.AddPicture(mFilePath+vImgName);
}
//if (mInlineShapes!=webform.WebOffice.ActiveDocument.InlineShapes.Count){
// mImgShape = webform.WebOffice.ActiveDocument.InlineShapes.Item(webform.WebOffice.ActiveDocument.InlineShapes.Count).ConvertToShape();
//}
//if (mShapes!=webform.WebOffice.ActiveDocument.Shapes.Count){
// mImgShape = webform.WebOffice.ActiveDocument.Shapes.Item(webform.WebOffice.ActiveDocument.Shapes.Count);
//}
mImgShape=mInlineShares.ConvertToShape();
mImgShape.Select();
mImgShape.PictureFormat.TransparentBackground = vTrans;
mImgShape.PictureFormat.TransparencyColor = 16777215;
mImgShape.Fill.Visible = false;
mImgShape.WrapFormat.Type = 3;
mImgShape.ZOrder(vZOrder);
}
//如果是Excel文档
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);
来源: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-8 21:41:42