Thread: [Solved] Resize and align
View Single Post
 
Old 11-08-2012, 07:01 AM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

You probably need to explain more clearly the end product but this should get you close.

Sub fixalign()
Dim oshp1 As Shape
Dim oshp2 As Shape
Set oshp1 = ActiveWindow.Selection.ShapeRange(1)
Set oshp2 = ActiveWindow.Selection.ShapeRange(2)
oshp1.Width = oshp1.Width * 0.3
oshp2.Width = oshp2.Width * 0.3
oshp1.Top = 100
oshp2.Top = 100
oshp1.Left = 100
oshp2.Left = 100 + oshp1.Width
'group to centre
ActiveWindow.Selection.ShapeRange.Group.Select
ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
'ungroup again
ActiveWindow.Selection.ShapeRange.Ungroup
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote