zoukankan      html  css  js  c++  java
  • Word VBA批量修改图片大小

    Alt+F11/F8

    这部分要说的是把word中的所有图片按比例缩放!
    具体操作同上,只是代码部分稍做修改,代码如下:

    Sub setpicsize() '
    设置图片大小
    Dim n '
    图片个数
    Dim picwidth
    Dim picheight
    On Error Resume Next '
    忽略错误
     
    For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes
    类型图片 
    picheight = ActiveDocument.InlineShapes(n).Height
    picwidth = ActiveDocument.InlineShapes(n).Width
    ActiveDocument.InlineShapes(n).Height = picheight * 1.1 '
    设置高度为1.1
    ActiveDocument.InlineShapes(n).Width = picwidth * 1.1 '
    设置宽度为1.1 
    Next n
    For n = 1 To ActiveDocument.Shapes.Count 'Shapes
    类型图片 
    picheight = ActiveDocument.Shapes(n).Height
    picwidth = ActiveDocument.Shapes(n).Width
    ActiveDocument.Shapes(n).Height = picheight * 1.1 '
    设置高度为1.1 
    ActiveDocument.Shapes(n).Width = picwidth * 1.1 '
    设置宽度为1.1
    Next n
    End Sub

    Sub 图片尺寸一起调()
    '
    '
    图片尺寸一起调 '
    '
    Mywidth = 15 '10
    为图片宽度(厘米)
    ' Myheigth = 10 '10
    为图片高度(厘米)
    For Each iShape In ActiveDocument.InlineShapes
    ' iShape.Height = 28.345 * Myheigth
    iShape.Width = 28.345 * Mywidth
    Next iShape
    End Sub

  • 相关阅读:
    eclipse 10个常用 快捷键
    struts2 s:set标签
    web项目的路径问题
    linux系统中用户切换
    java的多线程(一)
    Mongodb 与 Mongoose 的使用
    escape()、encodeURI()、encodeURIComponent()区别详解
    JSON WEB TOKEN
    关于使用REST API
    mac下设置mongodb开机启动方法
  • 原文地址:https://www.cnblogs.com/mmqh/p/3329597.html
Copyright © 2011-2022 走看看