Sub 图片批量加边框()
Application.ScreenUpdating = False
'以下代码调整嵌入式图片边框
Dim inshape As InlineShape
For Each inshape In ActiveDocument.InlineShapes
inshape.Select
With inshape.Borders
.OutsideLineStyle = wdLineStyleSingle '边框风格'
.OutsideColorIndex = wdColorAutomatic '颜色为自动, 通常为黑色
.OutsideLineWidth = wdLineWidth025pt '边框粗细,设置边框为0.25pt
End With
Next
'以下代码调整普通图片边框, 个别版本 wps 无效.很奇怪
Dim myPic As shape
For Each myPic In ActiveDocument.Shapes
If myPic.Type = msoPicture Then '如果shape类型为图片
myPic.Select
Selection.ShapeRange.Line.Weight = 0.25 '设置边框为0.25pt
End If
Next
Application.ScreenUpdating = True
End Sub
word VBA图片批量加边框
于 2024-08-30 15:09:17 首次发布