GroupShapes 对象 (Publisher)

代表组合形状中的单个形状。 每个形状表示 形状 对象。 使用 项目 方法与此对象,您可以使用组合中的单个形状而不必取消组合。

备注

使用 Shape.GroupItems 属性可返回 GroupShapes 集合。 使用 GroupItems (索引) ,其中 index 是分组形状中单个形状的数目,可以从 GroupShapes 集合返回单个形状。

示例

下面的示例向活动文档添加三个三角形,将它们组合,设置整个组的颜色然后更改第三个三角形的颜色。

Sub WorkWithGroupShapes() 
 With ActiveDocument.Pages.Add(Count:=1, After:=1).Shapes 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 50, 50, 100, 100).Name = "shpOne" 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 200, 50, 100, 100).Name = "shpTwo" 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 350, 50, 100, 100).Name = "shpThree" 
 With .Range(Array("shpOne", "shpTwo", "shpThree")).Group 
 .Fill.PresetTextured PresetTexture:=msoTextureBlueTissuePaper 
 .GroupItems(3).Fill.PresetTextured _ 
 PresetTexture:=msoTextureGreenMarble 
 End With 
 End With 
End Sub

方法

属性

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。