I'm trying to create a macro that reverts all the selected shapes from PowerClip to normal shapes but without success.
My question is: Where is the PowerClip - Frame - No Frame in the VBA. I can't find it.
And no, if you have more than one PowerClip selected you can't access this menu item.
Because I usually do this for many shapes at once it would be greate to have.
My current code is:
Sub RevertPowerClipToShape() ActiveDocument.ReferencePoint = cdrCenter Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange Dim s As Shape If ActiveSelectionRange.Count = 0 Then MsgBox "No shapes selected" Exit Sub Else For Each s In OrigSelection s.PowerClip.Shapes.All.Delete Next s End IfEnd Sub
This removes the objects inside the powerclip but I still have the Frame on the shape.
Any help would be appreciated.
Rob Pereira said:reverts all the selected shapes from PowerClip to normal shapes
For Each s In OrigSelection
Thank you for your answer.
Gives this error:
"Object doesn't support this property or method"
you must select powerclips only
Yes, i have tryed. With only one selected.
When you say 'frame of the shape' you mean the PowerClip itself?
If not, what do you mean?
Should we understand that your 'OrigSelection' means manually selected shapes from the powerclip in Edit mode? If not what does it mean?
If yes, you should catch the powerclip itself in a variable and after that do whatever you need (select shapes according to some criteria and select/delete/extract/etc. Recommendable to enter the EditMode of the powerclip) and finally delete the powerclip itself shape using the code:
I can halp with a piece of code only if I understand what you mean... Maybe my English is not good enough, but I cannot understand what you are trying to do...
FaneDuru said:but after enter the EditMode of the powerclip) and finally delete the powerclip itself shape using the code
But why do you need to go into the Editmode of the powerclip?
It depends on what he needs to do with the shapes. For instance to determine if their boundaries exceeds the powerclip boundaries. The part of EditMode was connected with whatever he needs to do with the existing shapes inside powerclip. Inside the parenthesis...
What did you understand about 'OrigSelection' meaning?
OrigSelection - is a standard ActiveSelectionRange 's name when recording a macro