Hello.
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.
Best regards.
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:
PCl.PowerClip.Parent.Delete
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?
Not mandatory...
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?
I do not understand what you mean by 'perform a mouse click'? To do that programmatically according to some parameters?
But beside that the next example of code does not work for you?
You should select the POWERCLIP SHAPE!
Dim S as Shape
Set S = Active Shape
S.PowerClip.ExtractShapes
S.PowerClip.Parent.Delete
OrigSelection - is a standard ActiveSelectionRange 's name when recording a macro