Automatically Sizing Photos with Macros

N

nate

I would like to add a number of pictures in Word 07 and have a macro
automatically size them to 2.25" x 3.00". What marco would I need to use?
 
J

Jean-Guy Marcil

nate said:
I would like to add a number of pictures in Word 07 and have a macro
automatically size them to 2.25" x 3.00". What marco would I need to use?

For inline pictures:

Sub ResizeInlinePix()

Dim i As Long

With ActiveDocument.InlineShapes
For i = 1 To .Count
With .Item(i)
If .Type = wdInlineShapePicture Then
.Width = InchesToPoints(3)
.Height = InchesToPoints(2.25)
End If
End With
Next
End With

End Sub




And for floating pictures:


Sub ResizeFloatingPix()

Dim i As Long

With ActiveDocument.Shapes
For i = 1 To .Count
With .Item(i)
If .Type = msoPicture Then
.LockAspectRatio = msoFalse
.Width = InchesToPoints(3)
.Height = InchesToPoints(2.25)
End If
End With
Next
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top