View Single Post
 
Old 05-14-2019, 04:01 PM
DaveP DaveP is offline Windows 10 Office 2010
Novice
 
Join Date: May 2019
Posts: 11
DaveP is on a distinguished road
Default Align and Distribute Images in Word with a Macro

Hello,

I am trying to get multiple (usually 3) images to align to each other. Basically, they need to be the same height, have a 1 inch border, aligned at the top, equidistant from each other(we can say .5 inches, I haven't decided yet), and all in a group. Here's what I have so far-- you select all 3 images and run this macro:


Sub Test()
Set myShapeRange = Selection.ShapeRange
myShapeRange.Align msoAlignTops, False
With myShapeRange
.Line.Weight = 1
.Line.Visible = msoTrue
.LockAspectRatio = msoTrue
.Height = InchesToPoints(1.5)
End With
Selection.ShapeRange.Group.Select
End Sub


The process is we paste in 3 images and then do all of that stuff individually, so it's a nice time saver (we do it several hundred times a day, the time adds up). The only thing this won't do is distribute them evenly, and with a set distance from each other. I can click "distribute horizontally" in the format menu, but I want to be able to adjust how close the images are to each other (distribute horizontally makes them distribute inside of the total space the images cover originally). Any help is welcomed!! Thanks!



TL;DR: pictures need to be .5 inches away from each other and aligned at their tops
Reply With Quote