How to ungroup all in all pages including inside powerclip?
Assuming that you want to keep the ungrouped shapes inside the powerclip you could do something like this:
Sub UngroupItAll() Dim p As Page Dim sr As ShapeRange, srPowerclipShapes As ShapeRange Dim s As Shape For Each p In ActiveDocument.Pages p.Shapes.All.UngroupAll Set sr = p.Shapes.FindShapes(Query:="!@com.powerclip.IsNull") For Each s In sr.Shapes Set srPowerclipShapes = s.PowerClip.ExtractShapes.UngroupAllEx srPowerclipShapes.AddToPowerClip s Next s Next p End Sub
Happy Coding!
-Shelby
A little update
Sub UngroupItAll() Dim p As Page Dim sr As ShapeRange, srPowerclipShapes As ShapeRange Dim s As Shape
For Each p In ActiveDocument.Pages p.Shapes.All.UngroupAll
Set sr = p.Shapes.FindShapes(Query:="!@com.powerclip.IsNull")
For Each s In sr.Shapes s.PowerClip.Shapes.FindShapes.UngroupAll Next s Next pEnd Sub
Lev,
I am not by a computer to test this but I believe in your version the shapes will be extracted from the poweclip. In my version they should ungroup but remain in the poweclip.
Both behavior may be desirable so I appreciate that you took the time to post your change.