我想创建一个代码,它将调整所选图像的大小,相应地放置它,在它下面创建2个文本框,最后将图像和2个文本框分组在一起。VBA Powerpoint分组数组?
我的总体目标是制作2个额外的宏,它们将执行相同的功能,但将它们定位在中间和右侧。
我似乎无法弄清楚如何组合3个形状。
下面是我的代码如下。
Dim LeftPic As ShapeRange, sld As Slide, ByeBox As Shape, HelloBox As Shape
Set LeftPic = ActiveWindow.Selection.ShapeRange
Set sld = Application.ActiveWindow.View.Slide
With LeftPic
.Left = 0.17 * 72 '72 is the multiplier for the inch
.Top = 1.83 * 72
.Height = 4.27 * 72
.Width = 3.2 * 72
End With
LeftPic.Name = "LeftPic"
Set HelloBox = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, _
0.17 * 72, Top:=6.17 * 72, Width:=200, Height:=50)
HelloBox.TextFrame.TextRange.Text = "Hello"
HelloBox.Name = "HelloBox"
Set ByeBox = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, _
0.17 * 72, Top:=6.42 * 72, Width:=200, Height:=50)
ByeBox.TextFrame.TextRange.Text = "Goodbye"
ByeBox.Name = "ByeBox"
Shapes.Range(Array("HelloBox", "ByeBox", "LeftPic")).Group
完美!非常感谢!! :) – DaniDarko