G'day Dave,
Sorry for taking so long to reply each time - work, time-zones, etc.
I am not sure if the picture is pasted sometimes as a Shape and sometimes as an InlineShape - I borrowed that code, and kept both for redundancy. For the sake of testing, I have just split the code into two subs, and tested them separately - ie, one only dealing with Shapes and the other only with InlineShapes. Ie:
Sub Paste_SizeAndCrop_FEH_DShape()Dim Rng As Range
Set Rng = Selection.Range
With Rng
.Paste
With .ShapeRange(1)
.LockAspectRatio = msoTrue
.Width = CentimetersToPoints(18)
With .PictureFormat
.CropBottom = CentimetersToPoints(-0.5)
End With
MsgBox "Shaperange " & .Height & "/" & .Width
End With
End With
End Sub
and:
Sub Paste_SizeAndCrop_FEH_DEHInline()
Dim Rng As Range
Set Rng = Selection.Range
With Rng
.Paste
With .InlineShapes(1)
.LockAspectRatio = msoTrue
.Width = CentimetersToPoints(18)
With .PictureFormat
.CropBottom = CentimetersToPoints(-0.5)
End With
MsgBox "InlineShape " & .Height & "/" & .Width
End With
End With
End Sub
Only the "InlineShape" version works, the other throws a "Run-time error '5': Invalid procedure call or argument", (debug highlights "With .ShapeRange(1)") so I suppose I am pasting InlineShapes. However, the "InlineShape" sub still does not work properly in the *.doc environment - the picture aspect ratio changes to be slightly stretched in the horizontal direction.
If I save the *.doc as a *docx, the code works, but I want to avoid doing that, as most of my colleagues work with the *.doc format, and I don't wish to inadvertently introduce formatting issues by the conversions from one form to the other and then back.