word中批量修改所有图片的尺寸

1、Crtl + F11 调出VBA

2、在对应位置输入代码

Sub 批量设置图片大小()
'
' Macro 宏
'
'
Myheigth = 12
Mywidth = 8
On Error Resume Next '忽略错误
For Each iShape In ActiveDocument.InlineShapes
iShape.Height = 28.345 * Myheigth '设置图片高度为任意cm
iShape.Width = 28.345 * Mywidth '设置图片宽度
Next
For Each Shape In ActiveDocument.Shapes
Shape.Height = 28.345 * Myheigth '设置图片高度为任意cm
Shape.Width = 28.345 * Mywidth '设置图片宽度
Next
End Sub

发表评论