图片格式:使用VBA“与文字位置一致”

问题描述 投票:0回答:1

需要使用宏立即将文档中所有图像的位置更改为“与文本对齐”。照片上所需的按钮

我试图在VBA参考中找到这个函数,但没有找到。

vba ms-word
1个回答
0
投票

微软文档:

Document.InlineShapes 属性(Word)

Document.Shapes 属性(Word)

Option Explicit

Sub demo()
    Dim oShp As Shape
    Dim ilShp As InlineShape
    ' Loop through all shapes in the document
    For Each oShp In ActiveDocument.Shapes
        If oShp.Type = msoPicture Then
            ' Convert to InlineShape
            oShp.ConvertToInlineShape
        End If
    Next
    For Each ilShp In ActiveDocument.InlineShapes
        If ilShp.Type = wdInlineShapePicture Then
            ilShp.WrapFormat.Type = wdWrapInline
        End If
    Next
End Sub
© www.soinside.com 2019 - 2024. All rights reserved.