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

  • 相关阅读:
    枚举子集 Codeforces306 Div2 B
    UVA140 剪枝
    回溯法浅谈
    UVA10976
    UVA11059
    BZOJ3355
    hdu 2509 博弈 *
    博弈专题
    hdu 1404 找sg ***
    hdu 4759 大数+找规律 ***
  • 原文地址:https://www.cnblogs.com/mmqh/p/3329597.html
Copyright © 2011-2022 走看看