Word 批量图片尺寸调整和编号添加宏代码
Sub ResizeAndNumberImages() Dim i As Integer Dim shp As Shape Dim count As Integer count = 1
For i = 1 To ActiveDocument.Shapes.Count
Set shp = ActiveDocument.Shapes(i)
If shp.Type = msoPicture Then
shp.LockAspectRatio = msoFalse '取消锁定纵横比
shp.Height = CentimetersToPoints(3.88) '设置高度为3.88cm
shp.Width = CentimetersToPoints(4.3) '设置宽度为4.3cm
'添加编号
ActiveDocument.Range(shp.Anchor.Paragraphs(1).Range.End + 1).Select
Selection.TypeText Text:=count & ". "
count = count + 1
End If
Next i
End Sub
原文地址: https://www.cveoy.top/t/topic/nTvE 著作权归作者所有。请勿转载和采集!