打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
OLE方式 word中插入图片
                     我是在delphi中用olecontainer操作word,要向其中插入图片,使用粘贴板。但是图片放入后位置是这一行的开始位置,如下:  
      {   将一副图片粘贴到word中   }  
      ClipBoard.Assign(aImage.Picture);  
      {   以下为vba代码--可在word中利用录制宏的功能取得--------------------bagin   }  
      {           使用vba之前加   x.OleObject.application   例如:excel添加工作表   }  
      {                   oc.OleObject.application.sheets.Add;       }  
      intInlineShapesIndex:=ocDoc.OleObject.application.ThisDocument.InlineShapes.Count+1;  
      intShapesIndex:=ocDoc.OleObject.application.ThisDocument.Shapes.Count+1;  
      //从剪贴板添加一个图片  
      ocDoc.OleObject.application.Selection.Paste;  
      //转换为图形  
      ocDoc.OleObject.application.ThisDocument.InlineShapes(intInlineShapesIndex).ConvertToShape;  
      //设置文字环绕方式  
      ocDoc.OleObject.application.ThisDocument.Shapes(intShapesIndex).WrapFormat.Type   :=   'wdWrapThrough';  
      //将图片中的白色设为透明色  
      ocDoc.OleObject.application.Selection.InlineShapes(intShapesIndex).PictureFormat.TransparentBackground   :=   'msoTrue';  
      ocDoc.OleObject.application.Selection.InlineShapes(intShapesIndex).PictureFormat.TransparencyColor:='RGB(255,255,255)';  
      ocDoc.OleObject.application.Selection.InlineShapes(intShapesIndex).Fill.Visible   :=   'msoFalse';  
      {   以上为vba代码--可在word中利用录制宏的功能取得----------------------end   } Top
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
Excel [分享]成功解决DOC文档写入Access数据库并完整读出的问题
自由移动Word2003中的图片与图形
word文档中插入图片的多种方式,这么多种图片插入方式,你会吗?
word中插入图片的三种方式,还可以直接插入网上图片,要会哦
文本框环绕方式
在Word中插入图片,如何将“衬于文字下方”设置为默认设置?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服