通過執行宏命令批量給word中的圖片加邊框?

word批量給word中的圖片加邊框

工具/原料

word2010

方法/步驟

打開word中的視圖標籤卡,選擇宏,然後查看宏

通過執行宏命令批量給word中的圖片加邊框

通過執行宏命令批量給word中的圖片加邊框

創建宏命令,自己可以命名也可以使用系統中的名字,這個不影響最後的效果

通過執行宏命令批量給word中的圖片加邊框

粘貼如下代碼:

Sub Example()

Dim oInlineShape As InlineShape

Application.ScreenUpdating = False

For Each oInlineShape In ActiveDocument.InlineShapes

With oInlineShape.Borders

.OutsideLineStyle = wdLineStyleSingle

.OutsideColorIndex = wdColorAutomatic

.OutsideLineWidth = wdLineWidth050pt

End With

Next

Application.ScreenUpdating = True

End Sub

通過執行宏命令批量給word中的圖片加邊框

執行宏命令

通過執行宏命令批量給word中的圖片加邊框

最終效果

通過執行宏命令批量給word中的圖片加邊框

注意事項

想要邊框更粗的話可以使用如下代碼

Sub Example() Dim oInlineShape As InlineShape Application.ScreenUpdating = False For Each oInlineShape In ActiveDocument.InlineShapes With oInlineShape.Borders .OutsideLineStyle = wdLineStyleThinThickSmallGap .OutsideColorIndex = wdColorAutomatic .OutsideLineWidth = wdLineWidth300pt End With Next Application.ScreenUpdating = True End Sub

相關問題答案