Continuing my earlier post above, I've got a challenge when using the code in one of my templates.
If I put Paul's final coding into a test .dotm it works perfectly every time. Thanks!
I then transfer the code to one of my .dotm templates expecting it to run the same as the test template but it doesn't. Well, it works OK if the picture is an inline shape but when it is a shape it fails.
The code is below:
ElseIf Selection.Type = wdSelectionShape Then
BShp = True
With Selection.ShapeRange
PicWdth = .Width
PicHght = .Height
VRel = .RelativeVerticalPosition
HRel = .RelativeHorizontalPosition
VPos = .Top
HPos = .Left
Set iShp = .ConvertToInlineShape
End With
With iShp
Set Rng = .Range
.Range.Cut
End With
Everything seems to work up to the point where it meets '.Range.Cut' when instead of cutting it to the clipboard it seems to just delete it as it doesn't seem to have arrived at the clipboard, therefore an error comes up when it's going to be pasted into the receiving table cell.
I've changed the code in all ways but still the picture does not get placed in the clipboard. I cannot understand it as it worked well in my test template.
Any thoughts or suggestions, please?