【Word】批量修改图片大小
Word中插入多张图片,尺寸不一,可以通过宏,批量修改图片大小
1:打开word,插入多张图片
2:Alt + F8 打开宏页面(如果电脑的键盘有Fn键,那么有可能需要Fn + Alt + F8),在宏名处,输入一个名字,如:FormatPics
3:点击“创建”按钮
4:输入如下代码
1 2 3 4 5 6 7 8 9 10 |
Sub FormatPics() Dim Shap As InlineShape For Each Shap In ActiveDocument.InlineShapes If Shap.Type = wdInlineShapePicture Then Shap.LockAspectRatio = msoFalse '不锁定纵横比 Shap.Width = CentimetersToPoints(9) '宽9CM Shap.Height = CentimetersToPoints(6.5) '高6.5CM End If Next End Sub |
5:保存、关闭宏编辑页面
6:Alt + F8 再次打开宏
7:此时,刚刚创建的宏“FormatPics”已存在,点击“运行”按钮即可。