Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2023, 10:24 AM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office for Mac 2011
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default Aligning Images Equally

I have MS Word on a Mac.

I have a Word document with a table in it.



On one of the rows, I have about 5 images. But they are not spaced equally from each other.

Is there a quick way to make them all equidistant from each other, even if its with VBA?

JH
Reply With Quote
  #2  
Old 11-05-2023, 07:41 PM
Guessed's Avatar
Guessed Guessed is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Are the images placed inline or are they floating?

I would say, make sure all are placed inline and have a space between each one and a soft return at the end. Then apply the paragraph alignment 'justify' (align left and right edges) to the paragraph they are sitting in. If the spacing doesn't 'appear' to be equal then check the white space around each graphic.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 11-05-2023, 11:53 PM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default



I have it inline.
The document is sent to me from my work so I can't change the layout.

I get the document with the images in a line but not equally spaced.

I cant press enter after each one otherwise it would create another line.

Because I have hundreds of these types of rows to deal with, I'm looking for an easy way to make them equidistant all in one go.

Any ideas for that?

JH

Reply With Quote
  #4  
Old 11-06-2023, 12:30 AM
Guessed's Avatar
Guessed Guessed is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You asked how to change the layout and then said you can't change the layout - do you expect the fix to do anything or nothing?

I said put one space between graphics on each line. You can do that with a search and replace to do it all in one go.
Find: ^g
Replace with: ^&[space]

Then add a soft return in front of each paragraph mark. Which can also be done with find and replace.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 11-06-2023, 06:00 AM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default



The current spaces are random so if I add a space between each one they will still be non-equidistant.
Reply With Quote
  #6  
Old 11-06-2023, 10:19 AM
kilroyscarnival kilroyscarnival is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2021
Expert
 
Join Date: May 2019
Posts: 345
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

Ideally, instead of all being in the same row, there'd be five columns, with one picture in each cell.

But barring that, to me the easiest thing would be to change all the images from wrapping "in line with text" to "Square" or something else. Then you can select all the images in the row and use the Align tools to Distribute Horizontally.

That works for one row, but if you want row after row to also line up vertically, again, you'd be better off breaking your rows into columns so you have an even grid. You could do that and make the internal column borders non-printing.

Another possibility - if you have to leave them in line with text, add a wide white border around each image which should provide the same space left and right on each image. You'll also have that white space top and bottom as well.

When I inserted five pictures in one row, and resized them, the in line with text option seemed to automatically butt them up tightly against each other. I'm surprised yours didn't do that?
Reply With Quote
  #7  
Old 11-06-2023, 10:39 AM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default

Thanks for that. I'm going to try out your suggestions.

I get this document every day from my workplace and its already set like this.

I can't make any changes except to clean it up a bit. So I can't add any columns to the table.

I'll see if that square method works.
Thanks,

JH
Reply With Quote
  #8  
Old 11-06-2023, 10:44 AM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default

Just tried that, and I cant really select all images in one go to change the wrapping. It will only allow me to select one image.
Also, the Distribute option does not appear if I run my mouse over all the images and select them that way.
Reply With Quote
  #9  
Old 11-07-2023, 02:36 PM
Guessed's Avatar
Guessed Guessed is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You need to post a sample document, not a screenshot of it.

Based on the screenshot, it appears that you are looking at white borders that are part of the photos, not spaces in between the photos. In that case you would need to crop the images to remove the 'white' areas. And the second row image is not going to align with the image above if they are different widths.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #10  
Old 11-08-2023, 11:18 AM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default

They are definitely spaces in between but some are 5 spaces, some 2 and some 3 etc...
I have to manually insert the cursor there and press space or delete to line them up.

The row is part of a whole table.
And I have multiple tables with similar images in the document.

So I'm wondering if I can maybe use a Macro to just space them evenly between each other with 2 spaces.
Dont need the upper row aligned with the images on the bottom row. Just need each row equidistant between its own pictures.

JH
Reply With Quote
  #11  
Old 11-08-2023, 02:22 PM
Guessed's Avatar
Guessed Guessed is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You still haven't provided a sample doc so I'm not bothering with creating a macro to deal with an undefined problem.

Your screenshot shows a different colour between the graphics than the rest of the table background. Make all the non-printing characters visible and show us another screenshot so we can see what is actually between the graphics.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #12  
Old 11-08-2023, 05:15 PM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default

I have uploaded a shortened version of the document here with 2 tables.

View Here

JH
Reply With Quote
  #13  
Old 11-09-2023, 08:44 PM
Guessed's Avatar
Guessed Guessed is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this macro
Code:
Sub SpaceBalls()
  Dim aRng As Range, aSty As Style
  Set aRng = ActiveDocument.Content
  Set aSty = ActiveDocument.Styles(wdStyleHtmlPre)
  aSty.ParagraphFormat.Alignment = wdAlignParagraphDistribute
  With aRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^g"
    .Replacement.Text = "^& "
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = False
    .Execute Replace:=wdReplaceAll
    .Text = "[ ]{2,}"
    .Replacement.Text = " "
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
    .Format = True
    .Text = "^g"
    .Replacement.Text = "^&"
    .MatchWildcards = False
    .Replacement.Style = aSty 
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #14  
Old 11-10-2023, 08:27 AM
Jetheat Jetheat is offline Aligning Images Equally Mac OS X Aligning Images Equally Office 2016 for Mac
Novice
Aligning Images Equally
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default

Thanks a lot for this. Much appreciated.

My company doesn't like to spread the images across the whole row.

They would like me to place the images with 1 or 2 spaces in between each image, starting from the left.

Can this code be modified to do that?

Really appreciate this effort.

JH
Reply With Quote
  #15  
Old 11-10-2023, 08:25 PM
Guessed's Avatar
Guessed Guessed is offline Aligning Images Equally Windows 10 Aligning Images Equally Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

To standardise on one space
Code:
Sub SpaceBallsOneSpace()
  Dim aRng As Range, aSty As Style
  Set aRng = ActiveDocument.Content
  With aRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^g"
    .Replacement.Text = "^& "
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = False
    .Execute Replace:=wdReplaceAll
    .Text = "[ ]{2,}"
    .Replacement.Text = " "
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Aligning Images Equally Opening all selected images, resizing images and placing them into a table. John Livewire Word VBA 1 09-15-2017 11:24 PM
Aligning Images Equally How do I make all text in word equally lined? MRnightmuffin Word 2 08-21-2017 03:21 PM
Aligning Images Equally Distribute shapes equally Losey Visio 2 11-18-2014 01:29 PM
Equally allocate/assign across resouces chconnors Project 1 06-01-2011 03:27 AM
Aligning Images Equally Mail Mege Images - Path Correct but Images Repeated Sonia Sosa Mail Merge 8 04-22-2011 03:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft