1

VBA を使用して Word 文書の画像のサイズを変更しようとしています。コードは正常に動作しますが、実行されるのは 2 回目だけです。中断してからステップスルーする場合にも機能します。誰かが私が欠けているものについてコメントできますか?

Documents.Open FileName:=vDirectory & "\" & vFile

Dim objPic As InlineShape
For Each objPic In ActiveDocument.InlineShapes

If objPic.Width > CentimetersToPoints(16.51) Then
    With objPic
        .Width = CentimetersToPoints(16.51)
    End With
End If

Next objPic
4

1 に答える 1