Inlineshape.width and .height only works when debugging
Hi,
I'm inserting a picture in a Word table cell. Then I resize it using .Width and .Height. The strange thing is that it only works when I debug the code, using F8 to step through the commands.
When I remove the break points and execute the code, the picture doesn't resize. It gets the same width as the table cell... This is the code I'm using:
Code:
Dim oPic As InlineShape
Set oPic = ActiveDocument.InlineShapes.AddPicture(plotLocation & "\" & fileName, False, True, CellRange)
With oPic
.LockAspectRatio = False
.Width = CentimetersToPoints(15.5)
.Height = CentimetersToPoints(10)
End With
Note: plotLocation, fileName, CellRange are defined earlier in the code.
Any ideas?
Best regards,
David