On the Format tab, click the Align dropdown menu, shown below. (If you need to resize the shape to get it aligned properly, see the next section.) The next approach is to select all the shapes you want to align, which will cause Word to display the Format tab. Margins are weird and shapes are aligned infinitely instead of going into the next row. The first approach is to click on each shape and drag it to its new location. I tried using code for Horizontal alignment from this link: Here is a small example of what I want to achieve: NOTE: My macro already contains code for making all images have the same height(while keeping the same aspect ratio), so I think dimensions shouldn't be a problem. I have searched a lot on the internet, but I haven't found a way to achieve this. If there is not enough space to fit another image, I need it to go to the next row(just below previous images) and continue with the horizontal alignment of images. My goal is to write a VBA macro that will automatically align (distribute) all images in a Word document horizontally (next to each other) with a small margin on each side of every image. This is my first time writing macro in VBA.
0 Comments
Leave a Reply. |