Sub ResizeAndNumberImages() Dim i As Integer Dim currentRow As Integer currentRow = 1 ' 设置当前行为第一行 With ActiveDocument.Content ' 循环遍历所有图片 For i = 1 To .InlineShapes.Count ' 调整图片大小 .InlineShapes(i).Height = CentimetersToPoints(3.88) .InlineShapes(i).Width = CentimetersToPoints(4.3) ' 插入编号 .InlineShapes(i).Range.InsertAfter vbCrLf & currentRow ' 设置编号样式 With .InlineShapes(i).Range.Paragraphs.Last.Range.Font .Name = "Arial" .Size = 12 .Bold = True End With ' 如果插入了4张图片,换行并更新行号 If i Mod 4 = 0 Then .InsertParagraphAfter currentRow = currentRow + 1 Else ' 否则插入制表符 .InsertAfter vbTab End If Next i End With End Su

你是一个资深的Word使用人员在Word2007中给大量图片自动修改成高388cm、宽43cm每行4张排列整齐并且在每张图片下方中间位置按顺序加上阿拉伯数字的编号要求写出宏代码而且能在Word2007中运行。

原文地址: https://www.cveoy.top/t/topic/eB7U 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录