在日常办公或文档排版过程中,经常需要将 Word 文档中的多张图片统一调整为相同尺寸。手动一张张调整不仅费时,还容易出错。本文介绍几种高效实现Word 批量处理图片大小的方法,帮助您快速完成标准化排版。
这是最高效的批量处理方式,适用于熟悉基础 VBA 操作的用户:
Alt + F11 打开 VBA 编辑器。
Sub ResizeAllPictures()
Dim shp As Shape
Dim ilshp As InlineShape
For Each shp In ActiveDocument.Shapes
If shp.Type = msoPicture Then
shp.LockAspectRatio = msoTrue
shp.Width = CentimetersToPoints(10)
End If
Next shp
For Each ilshp In ActiveDocument.InlineShapes
If ilshp.Type = wdInlineShapePicture Then
ilshp.LockAspectRatio = msoTrue
ilshp.Width = CentimetersToPoints(10)
End If
Next ilshp
End Sub
Alt + F8,运行该宏即可。此方法适合不熟悉 VBA 的用户,但需注意格式可能略有变化。
部分在线或桌面工具支持对 Word 文档进行批量图片处理,例如: