Foxtable(狐表)用户栏目专家坐堂 → word报表图片添加


  共有4151人关注过本帖树形打印复制链接

主题:word报表图片添加

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112378 积分:572152 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/6 21:34:00 [显示全部帖子]

http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=126389

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=159575&skin=0

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112378 积分:572152 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/7 9:25:00 [显示全部帖子]

2楼第二个链接就有这个用法说明

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112378 积分:572152 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/7 9:59:00 [显示全部帖子]

http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=126389

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112378 积分:572152 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/7 10:46:00 [显示全部帖子]

学会结合使用呀

    Set sha = Selection.InlineShapes.AddPicture(filename:=projectpath & "images\张杰.png", linktofile:=False, savewithdocument:=True).ConvertToShape '插入图形
    With sha
        .WrapFormat.Type = wdWrapFront '设置文字环绕方式,wdwrapfront置于文字上方,wdwrapbehind置于文字下方,wdwrapthrough四周环绕……
        .LockAspectRatio = msoCTrue '锁定纵横比
        .Height = CentimetersToPoints(2) '缩小为原来的20%
        .RelativeHorizontalPosition = wdRelativeHorizontalPositionRightMarginArea '相对于右边距
        .Left = -.Width '取图片宽度的负数
        .RelativeVerticalPosition = wdRelativeVerticalPositionBottomMarginArea '相对于下边距
        .Top = -.Height '取图片高度的负数
    End With

 回到顶部
帅哥,在线噢!
有点蓝
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112378 积分:572152 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/7 11:55:00 [显示全部帖子]

   Dim pic = app.Selection.InlineShapes.AddPicture(filename:=img, linktofile:=False, savewithdocument:=True).ConvertToShape '插入图形
    With pic
        .WrapFormat.Type = MSWord.WdWrapTypeMerged.wdWrapFront
        .Height = app.CentimetersToPoints(2) '缩小为原来的20%
        .RelativeHorizontalPosition = MSWord.WdRelativeHorizontalPosition.wdRelativeHorizontalPositionRightMarginArea '相对于右边距
        .Left = -.Width '取图片宽度的负数
        .RelativeVerticalPosition = MSWord.WdRelativeVerticalPosition.wdRelativeVerticalPositionBottomMarginArea '相对于下边距
        .Top = -.Height '取图片高度的负数
        .LockAspectRatio = True
        .Height = 100
    End With 

 回到顶部
帅哥,在线噢!
有点蓝
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112378 积分:572152 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/7 13:36:00 [显示全部帖子]

这个是替换,当然没有了。在盖章右边再添加4个字:【盖章】

app.Selection.Find.Text = "【盖章】"

位置自己灵活调整一下
.Left = -.Width - 20 '取图片宽度的负数
.Top = -.Height - 50  '取图片高度的负数

 回到顶部