Auto format image layout in Word?

P

pjs

I have to create a syllabus for a talk. I sent my slides and notes from
PowerPoint to Word. Now I would like to shrink all of the slide images to 1"
by 1.33" and format them so they are left aligned with text wrapping around
the right side.

I tried doing this one by one with Record Macro, but it wouldn't let me do
the alignment part.

Is there a macro that can do this? I'm very, very new to VBA.

Thanks,

pjs
 
M

macropod

Hi pjs,

The following macro will reformat all your document's 'floating' shapes:
Sub Reformat()
Dim oShp As Shape
For Each oShp In ActiveDocument.Shapes
With oShp
'.LockAspectRatio = msoFalse
.Height = InchesToPoints(1)
'.Width = InchesToPoints(1.33)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.Left = wdShapeLeft
With .WrapFormat
.AllowOverlap = False
.Side = wdWrapRight
.DistanceTop = InchesToPoints(0)
.DistanceBottom = InchesToPoints(0)
.DistanceLeft = InchesToPoints(0)
.DistanceRight = InchesToPoints(0)
.Type = wdWrapTopBottom
End With
End With
Next
MsgBox "Finished Reformatting."
End Sub

Note that there are two lines commented out. Ordinarily, the aspect ratio is locked, so changing the height affects the width also.
If it doesn't, then uncomment the line '.Width = InchesToPoints(1.33)'. If you're wanting to change the aspect ratio also, also
uncomment the line '.LockAspectRatio = msoFalse'.

If you only want to work with the selected shape(s), change 'For Each oShp In ActiveDocument.Shapes' to 'For Each oShp In
Selection.ShapeRange'

Cheers
 

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