Align Left & Right not working in Word 2007

L

LindaH

We're having trouble aligning a series of floating graphics (in front of
text). Usually we place them roughly on a page and select Align Left. This
command initially does nothing. If we play with the settings such as Align >
Align to Page and then set it back to Align Selected Objects, it works. And
once it starts working, it stays that way. The problem is that we have to do
many pages a day and we use align left on everything.

In addition to this, we're using a 2003 template in Word 2007 (for
compatibility reasons) and while most of other macros work fine, Align Left
and Align Right just don't do a thing, ever. Even if the ribbon command is
working, they don't. The code is simply Selection.ShapeRange.Align
msoAlignLefts, False which is the same as what is recorded if we create a new
macro. (Having all of the commands we need together on the Add-in tab makes a
huge difference to our speed.)

What can you suggest?

Many thanks,
Linda
 
B

BoniM

Code didn't work for me either... so it's not just you. If u want them
aligned to the left margin - the following code works:
WordBasic.AlignLeft
as does:
WordBasic.AlignRight

If you don't want them all the way to the margin:
WordBasic.AlignLeft
Selection.ShapeRange.IncrementLeft 72#
increments one inch from the left (measured in points, 72=1 inch, adjust as
desired).
To do the same from the right margin:
WordBasic.AlignRight
Selection.ShapeRange.IncrementLeft -72#

Have fun and good luck!
 
L

LindaH

Unfortunately we need to align the pictures with each other in a different
place each time. I guess we'll just align to a rough position and then adjust
manually. (What a pain!)

Thanks,
Linda
 
B

Bob Buckland ?:-\)

Hi Linda,

Can you provide the steps you're using when you encounter this?

You mentioned using a Word 2003 template but are the files you're using being 'seen' by Word 2007 as ones to be treated as Word 2003
format documents (i.e. if you click on the Office button in Word 2007 does the menu include a 'convert' option)?

If the inserted graphics have white pearl sizing handles then they're 'seen' by Word as Office 2007 pictures and Word 2007 doesn't
see them as graphic 'objects'. They won't be selected from
Home=>Edit=>Select=>Select Objects and the 'Align' tool on
Format=>Picture Tools for Position or alignment will be greyed out when you select a picture.

If you save the document as a Word 2003 document do the graphics change to blue sizing handles? If so, Word 2007 now treats them as
'regular' pictures and the alignment tools should work, in which case the code should work as well. The 'wordbasic' commands
mentioned in the previous message seem to have a way of working when the 'newer' ones don't <g>.

=============
We're having trouble aligning a series of floating graphics (in front of
text). Usually we place them roughly on a page and select Align Left. This
command initially does nothing. If we play with the settings such as Align >
Align to Page and then set it back to Align Selected Objects, it works. And
once it starts working, it stays that way. The problem is that we have to do
many pages a day and we use align left on everything.

In addition to this, we're using a 2003 template in Word 2007 (for
compatibility reasons) and while most of other macros work fine, Align Left
and Align Right just don't do a thing, ever. Even if the ribbon command is
working, they don't. The code is simply Selection.ShapeRange.Align
msoAlignLefts, False which is the same as what is recorded if we create a new
macro. (Having all of the commands we need together on the Add-in tab makes a
huge difference to our speed.)

What can you suggest?

Many thanks,
Linda >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
L

LindaH

(Now that I want it to happen, do you think I can reproduce it!? Of course
not.) The Align Left command works fine the majority of the time. It seems
that if I play with the grid settings the problem resolves itself until the
next session, but it is not consistent. The macro still does nothing in the
2003 docs, even when the menu command works, but the macro does work in a
2007 document where the images have the white pearl sizing handles that you
mentioned.

And, yes, the Convert option is displayed in my 2003 docs and the graphics
come in with blue sizing handles.

Oh so confusing!
 
B

BoniM

Selection.ShapeRange.Align msoAlignLefts, False

This code in a macro doesn't work no matter what kind of handles you have or
version you have saved in - and with further playing around, I've also
discovered it to be the source of Linda's buttons not working problem,
because once you run this code, Align left won't work at all until you align
something else first. It's actually kinda making me crazy that I can't
figure out a way to get it to work... 'specially since it does work in '03...
but then most people would probably say it's too late already on that crazy
thing. ;-)
 

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