答案1
手动方法是使用等距参考线拖动框以均匀分布形状。拖动形状时,这些参考线会自动出现(您会看到虚线),将形状与参考线对齐时,形状会“对齐”。
否则,如果您想冒险,可以使用 VBA 宏,它要求文件是.pptm
而不是.pptx
。
以下 VBA 宏将使所有选定的形状与第一个选定的对象垂直对齐,并按选择顺序排列:
Sub AlignMultipleShapes()
Dim shp As Shape
Dim count As Integer
Dim curix As Integer
Dim topy As Integer
Dim lastx As Integer
'Count How Many Shapes Are Selected
count = Windows(1).Selection.ShapeRange.count
'Loop Through each selected Shape (align with first selected)
For curix = 1 To count
If curix = 1 Then
Set shp = Windows(1).Selection.ShapeRange(1)
topy = shp.top
lastx = shp.Left + shp.Width
Else
Set shp = Windows(1).Selection.ShapeRange(curix)
'Align Top
shp.top = topy
'Align Center (Vertical Center)
shp.Left = lastx
lastx = shp.Left + shp.Width
End If
Next curix
End Sub
有用的参考资料: