1

I have searched and experimented with multiple answers to my question, but they don't seem to work. I have a database that prints to word a photo and text for each record. The information is presented in a table format, with the pic/image located in a row in the table. The images are created and saved by multiple users and are not all the same size. The database is resizing the images to a predetermined size that I do not want. I want to macro to resize all the images to 3.5" in height. I don't really care about the width, but want the aspect ratio to be locked. I have found some answers, but the aspect ratio solution doesn't seem to work. This component of the code ".LockAspectRatio = msoTrue" seems to be ignored when the macro is run. As a result, the image gets distorted or stretched. Any help would be greatly appreciated.

Here is the code I'm currently using, but I've tried some others:

Sub ResizePhotos() Dim pic As InlineShape

For Each pic In ActiveDocument.InlineShapes
    With pic
        .LockAspectRatio = msoTrue
        If .Width > .Height Then ' horizontal
            .Height = InchesToPoints(3.5)
        Else  ' vertical
            .Width = InchesToPoints(5)
        End If
    End With
Next

End Sub

0 Answers0