在日常办公或撰写报告时,经常需要将多张图片插入到 Word 文档中。然而,这些图片往往尺寸不一,手动一张张调整既费时又低效。本文将介绍几种高效的方法,帮助你批量统一调整 Word 中的图片大小。
这是最高效的自动化方式,适用于熟悉基础 VBA 操作的用户:
Alt + F11 打开 VBA 编辑器。
Sub ResizeAllPictures()
Dim shp As Shape
Dim ilshp As InlineShape
Dim height As Single, width As Single
height = InputBox("请输入图片高度(磅):", "高度", 300)
width = InputBox("请输入图片宽度(磅):", "宽度", 400)
For Each shp In ActiveDocument.Shapes
If shp.Type = msoPicture Then
shp.LockAspectRatio = msoFalse
shp.Height = height
shp.Width = width
End If
Next shp
For Each ilshp In ActiveDocument.InlineShapes
If ilshp.Type = wdInlineShapePicture Then
ilshp.LockAspectRatio = msoFalse
ilshp.Height = height
ilshp.Width = width
End If
Next ilshp
End Sub
运行后输入目标尺寸即可一键调整所有图片。
适合不熟悉 VBA 的用户,操作直观。
在插入 Word 前,使用图像批量处理软件(如 IrfanView、Photoshop 动作、在线工具等)统一图片尺寸,再导入 Word,可避免后期调整。