分享

通过执行宏命令批量给Word中的图片加边框

 hdzgx 2018-02-05

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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多