vba 设置图片格式

Posted 笑虾

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vba 设置图片格式相关的知识,希望对你有一定的参考价值。

设置图片格式

Sub setShapeStyle()
	' 声明个内嵌图片(暂时没用到)
    Dim theShape As InlineShape
    
    ' 关闭屏幕更新
    Application.ScreenUpdating = False
        
    For Each myShape In ActiveDocument.InlineShapes
        
        With myShape.Borders
            .OutsideLineStyle = wdLineStyleSingle '边框类型
            .OutsideColorIndex = wdBlack '边框颜色
            .OutsideLineWidth = wdLineWidth100pt '边框粗细
        End With
    
    Next
    ' 开启屏幕更新
    Application.ScreenUpdating = True

End Sub

参考资料

WdLineWidth 枚举

以上是关于vba 设置图片格式的主要内容,如果未能解决你的问题,请参考以下文章

excel vba 选择性粘贴并设置为真文本?

在word中自动插入图片 vba代码

VBA_单元格格式设置代码

用于替换单元格值并保持格式化的VBA脚本

报告格式化 VBA 代码

在EXCEL中,如何使用VBA设置单元格内指定字符串格式 三六零问答