我有两张照片,并希望将第二张照片的宽度裁剪为与使用VBA的第一张宽度相同的尺寸。我面临的问题是它会使它们几乎成长,但尺寸不一样(也许它只能通过整数来裁剪?)。
Sub CropPicture()
Dim W1 As Double
Dim W2 As Double
With ActiveWindow.Selection.ShapeRange(1)
w1 = .width
End With
With ActiveWindow.Selection.ShapeRange(2)
W2 = .width
With .PictureFormat
.CropLeft = (W2 - W1)/2
.CropRight = (W2 - W1)/2
End With
End With
End Sub
任何帮助都会非常感激,因为我是VBA新手