This example crops 20 points off the right side of shape three on myDocument
. For this example to work, shape three must be either a picture or an OLE object.
Set myDocument = Worksheets(1)
myDocument.Shapes(3).PictureFormat.CropRight = 20
Using this example, you can specify the percentage you want to cropp off the right side of the selected shape, regardless of whether the shape has been scaled. For the example to work, the selected shape must be either a picture or an OLE object.
percentToCrop = InputBox( _
"What percentage do you want to crop" & _
" off the right of this picture?")
Set shapeToCrop = ActiveWindow.Selection.ShapeRange(1)
With shapeToCrop.Duplicate
.ScaleWidth 1, True
origWidth = .Width
.Delete
End With
cropPoints = origWidth * percentToCrop / 100
shapeToCrop.PictureFormat.CropRight = cropPoints