R
Roderick O'Regan
I want to resize a selected picture using VBA but I only want to
change the width of the picture to say, 2cm and the height should
adjust to scale automatically.
Manually, using the Format>Picture command I can achieve this by
ensuring that Lock aspect ratio checkbox is True.
However, if I translate this to VBA using the following commands:
with Selection
.InlineShapes(1).LockAspectRatio = msoTrue
.InlineShapes(1).Width = CentimetersToPoints(2)
End With
....I would expect the same to happen as when I did it manually. Even
though the Lock aspect ratio is set to True it reduces the width to
2cm but leaves the height at its original value.
Am I using the correct commands, please?
change the width of the picture to say, 2cm and the height should
adjust to scale automatically.
Manually, using the Format>Picture command I can achieve this by
ensuring that Lock aspect ratio checkbox is True.
However, if I translate this to VBA using the following commands:
with Selection
.InlineShapes(1).LockAspectRatio = msoTrue
.InlineShapes(1).Width = CentimetersToPoints(2)
End With
....I would expect the same to happen as when I did it manually. Even
though the Lock aspect ratio is set to True it reduces the width to
2cm but leaves the height at its original value.
Am I using the correct commands, please?