共用方式為


GroupShapes 物件 (Excel)

代表群組圖案中的個別圖案。

註解

每個圖案是由 圖案 來表示 物件。 使用 項目 方法搭配這個物件,您可以使用單一圖案群組內不必 ungroup 它們。

範例

使用 Shape 物件的 GroupItems 屬性來傳回 GroupShapes 集合。

使用 GroupItems (索引) ,其中 索引 是分組圖形內個別圖形的數目,以從 GroupShapes 集合傳回單一圖形。

下列範例會在 myDocument 中新增三個三角形、將其組成群組、設定整個群組的色彩,然後單獨變更第二個三角形的色彩。

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 10, 10, 100, 100).Name = "shpOne" 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 150, 10, 100, 100).Name = "shpTwo" 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 300, 10, 100, 100).Name = "shpThree" 
 With .Range(Array("shpOne", "shpTwo", "shpThree")).Group 
 .Fill.PresetTextured msoTextureBlueTissuePaper 
 .GroupItems(2).Fill.PresetTextured msoTextureGreenMarble 
 End With 
End With

方法

屬性

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應