新建一个图片的样式
然后在宏里运行
代码参考来自这里
Sub CenterInLinePictures()Dim objInLineShape As InlineShapeDim objDoc As DocumentSet objDoc = ActiveDocumentFor Each objInLineShape In objDoc.InlineShapesobjInLineShape.SelectSelection.Style = ActiveDocument.Styles("图片")Next objInLineShape
End Sub
用宏命令对word里的图片尺寸大小进行批量修改的方法 - 知乎
参考这里补充更改图片尺寸大小的
Sub CenterInLinePictures()Dim objInLineShape As InlineShapeDim objDoc As DocumentSet objDoc = ActiveDocumentFor Each objInLineShape In objDoc.InlineShapesobjInLineShape.SelectSelection.Style = ActiveDocument.Styles("图片")objInLineShape.Height = 28.35 * 5 objInLineShape.Height = 28.35 * 5 '5的单位是厘米Next objInLineShape
End Sub