| 发表于:2007-03-08 10:02:558楼 得分:100 |
uses comobj; const msoscalefromtopleft = $00000000; msoscalefrommiddle = $00000001; msoscalefrombottomright = $00000002; msotrue = $ffffffff; msofalse = $00000000; var excel:variant; activesheet,activeshapes:variant; begin if not opendialog1.EXECute then exit; excel:=createoleobject( 'excel.application '); //打开工作簿 excel.workbooks.open(opendialog1.filename); //激活第1个表 activesheet:=excel.worksheets[1]; activesheet.activate; if opendialog1.EXECute then begin //添加图片 activeshapes:=activesheet.shapes.addpicture(opendialog1.filename,true,true,0,0,100,100); //选择图片 activeshapes.select; //调整大小 activeshapes.scalewidth( 0.44, msofalse, msoscalefromtopleft); activeshapes.scaleheight( 0.44, msofalse, msoscalefrombottomright); //移动位置 activeshapes.incrementleft(20); activeshapes.incrementtop(20); activeshapes:=unassigned; end; //保存 excel.save; //释放excel对象 activesheet:=unassigned; excel:=unassigned; | | |
|