Skip to content

Latest commit

 

History

History
68 lines (39 loc) · 1.44 KB

Word.Shape.Ungroup.md

File metadata and controls

68 lines (39 loc) · 1.44 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Shape.Ungroup method (Word)
vbawd10.chm161480727
vbawd10.chm161480727
Word.Shape.Ungroup
0e8ead12-19a7-4caf-696e-38509e30148d
06/08/2017
medium

Shape.Ungroup method (Word)

Ungroups any grouped shapes in the specified shape.

Syntax

expression.Ungroup

expression Required. A variable that represents a Shape object.

Return value

ShapeRange

Remarks

This method sisassembles pictures and OLE objects within the specified shapeand returns the ungrouped shapes as a single ShapeRange object.

Because a group of shapes is treated as a single object, grouping and ungrouping shapes changes the number of items in the Shapes collection and changes the index numbers of items that come after the affected items in the collection.

Example

This example ungroups any grouped shapes and disassembles any pictures or OLE objects on myDocument.

Set myDocument = ActiveDocument 
For Each s In myDocument.Shapes 
 s.Ungroup 
Next

This example ungroups any grouped shapes on myDocument without disassembling pictures or OLE objects on the document.

Set myDocument = ActiveDocument 
For Each s In myDocument.Shapes 
 If s.Type = msoGroup Then s.Ungroup 
Next

See also

Shape Object

[!includeSupport and feedback]