Share via


Shape.Ungroup メソッド (Visio)

グループを解除します。

構文

解除

Shape オブジェクトを表す変数。

戻り値

なし

次の VBA (Microsoft Visual Basic for Applications) マクロは、Ungroup メソッドの使用方法を示しています。

 
Sub Ungroup_Example() 
 
 Dim vsoShape1 As Visio.Shape 
 Dim vsoShape2 As Visio.Shape 
 Dim vsoShape3 As Visio.Shape 
 Dim vsoGroup As Visio.Shape 
 Dim vsoSelection As Visio.Selection 
 
 'Draw two rectangles. 
 Set vsoShape1 = ActivePage.DrawRectangle(1, 2, 2, 1) 
 Set vsoShape2 = ActivePage.DrawRectangle(1, 4, 2, 3) 
 
 'Add a copy of one of the rectangles to the page. 
 ActivePage.Drop vsoShape1, 3.5, 3.5 
 Set vsoShape3 = ActivePage.Shapes(3) 
 
 'Deselect all shapes, and then select all the shapes on the page. 
 Set vsoSelection = ActiveWindow.Selection 
 vsoSelection.Select vsoShape1, visDeselectAll + visSelect 
 vsoSelection.Select vsoShape2, visSelect 
 vsoSelection.Select vsoShape3, visSelect 
 
 'Group all the shapes into a group shape. 
 Set vsoGroup = vsoSelection.Group 
 
 'Ungroup the shapes. 
 vsoGroup.Ungroup 
 
End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。