word里用javascrpit把InlineShapes图片转化成Shape图

word里用javascrpit把InlineShapes图片转化成Shape图片,然后修改版式的问题
Code
代码如下:
var doc = new ActiveXObject('Word.Application');
var range = doc.Range; //选择的区域
var sel = doc.Selection; //选择点
var seal_picture = doc.InlineShape; //嵌入型图片
var str; //印章图片的路径和文件名
var seal_shape = doc.Shape; //粘贴版型图片
var docurl="C:\\temp\\"+document.forms[0].NewsTitleQG.value+".doc";
//doc.Visible = true;
doc.Documents.Open (docurl);
//doc.Application.Activate();
//获得书签位置
range = doc.ActiveDocument.Bookmarks("seal1").Range;
sel = range;
str = "D:\\印章\\南宁供电局合同印章2.bmp"; //插入图片
seal_picture = sel.InlineShapes.AddPicture(str);
//设置可用名
seal_picture.AlternativeText = "印章";
seal_picture.Select();//当前图片为焦点
seal_shape = seal_picture.ConvertToShape(); //类型转换
seal_shape.WrapFormat.Type = 3;//图片类型
seal_shape.ZOrder(5); //5 图片沉于文字 4 图片浮于文字
doc.ActiveDocument.SaveAs("C:\\temp\\bb.doc"); doc=null;

Code


var seal_picture=TANGER_OCX_OBJ.ActiveDocument.InlineShape;
seal_picture=TANGER_OCX_OBJ.ActiveDocument.FormFields('CheckedBy').Range.InlineShapes.AddPicture('http://localhost//mms\\UserSign\\aa.jpg');
seal_picture.Select(); //当前图片为焦点
seal_shape=seal_picture.ConvertToShape(); //类型转换
seal_shape.WrapFormat.Type = 3; //图片类型
seal_shape.ZOrder(5); //5 图片沉于文字 4 图片浮于文字

你可能感兴趣的:(JavaScript应用)