Sir
when multiple objects selected, and is consiting of powerclips,
allow to active the command NONE (Remove the powerclip contents).
regards
sriram
hope this makes you understand sir
convert all powerclips to none and delete all contents?
sir if for instance....
a group of selected powerclips or powerclips are grouped with other objects... my request is to remove all of them to None. Here None is active only for a single powerclip only.
Don't think that's what the "None" is for. You wish to remove or ignore powerclips from current selection? Again a simple macro can be made to do this.
It would really help if it were clearly explained what the "None" Command is.
I THINK that it is the Command that removes a PowerClip frame from an object, and shows up under Tools>Workspace>Commands>Object as "None".
If that is used on an empty PowerClip frame, it just removes the frame. If it's used on a PowerClip with contents, then the contents are discarded.
Shelby Moore showed a way to do this by invoking the Command by its GUID: CorelDRAW X6 - Changing Frame Type to None?
So, sure, one could make a macro to walk through a list of PowerClips and apply that to them. Shelby's example intentionally skips PowerClips that aren't empty.
None Means : empty PowerClip frame
sir it is important to remove the whole powerclips at once and to have outline when to give to for a die person for to prepare the die to cut the designs into pieces for box making purpose.
For instance... small cone shaped boxes are placed in a sheet more than 20 or 30 pieces. all are powerclipped. i have to give it to the die manufacturing company as an outline. for this purpose the empty powerclip frame is not active when i select them all. I have to select each and every piece and to have to remove. I want this to remove at once. Like Revert to Objects works for Symbol at once.
Sub RemovePowerclipFrame() Dim sr As ShapeRange, s As Shape Optimization = True ActiveDocument.BeginCommandGroup "ExtractAllPowerclipUltra" Set sr = ActiveSelectionRange For Each s In ActiveSelection.Shapes If Not s.PowerClip Is Nothing Then s.RemoveFromSelection s.PowerClip.ExtractShapes.Delete 's.RemoveFromSelection sr.AddToSelection If Not s.PowerClip Is Nothing Then If s.PowerClip.Shapes.Count = 0 Then s.CreateSelection Application.FrameWork.Automation.Invoke "7b022531-3cd7-487f-a797-9d80179dc821" End If End If End If DoEvents Next s Application.Optimization = False ActiveWindow.Refresh ActiveDocument.EndCommandGroupEnd Sub
Thanks for posting that, Myron.
An inquiring mind wants to know: What led you to put "DoEvents" in there?
In this case it isn't necessary. I pieced it together with bits from another that for some reason needed it.
hint "ExtractAllPowerclipUltra"
I already had a macro to extract the powerclip contents from a single powerclip and revert the frame back to none. Maybe a year later I decided it would be nice to be able to extract the contents from multiple powerclips and revert each frame to none. In writing the code the extraction would take place but only the last shape would revert back to none. When I put the DoEvents in there it then correctly reverted all shapes to none.
Sometimes my approach to macro coding isn't the best method that's why I call myself more of a hacker than a coder.
Myron said:In writing the code the extraction would take place but only the last shape would revert back to none.
That is exactly what I observed when I tried doing this, and it was very frustrating!
I looked at your code then, saw the DoEvents, and tried adding that to mine. Shazam! I have never used DoEvents before. So, again, I really appreciate you sharing that!
Perhaps this has something to do with using the "Invoke" stuff to do things that aren't directly exposed to us in the API?
I think that might defeat the purpose of using a CommandGroup, though. If I try your macro and then check the undo list, it's not all under one entry. This is what it looks like after processing three PowerClips in a selection:
I will also comment that I don't think one needs to do any extracting/deleting; the "Unassign Frame" seems to take care of that automatically. After adding DoEvents, I was able to strip my version down to this:
Sub Unassign_PowerClip_frames() Dim sr As New ShapeRange Dim s As Shape On Error GoTo ErrHandler sr.AddRange ActiveSelectionRange For Each s In sr If Not s.PowerClip Is Nothing Then s.CreateSelection Application.FrameWork.Automation.InvokeItem "7b022531-3cd7-487f-a797-9d80179dc821" DoEvents End If Next s ExitSub: Refresh Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description & vbCrLf & vbCrLf & "Unassign_PowerClip_frames()" Resume ExitSub End Sub
Hmm in testing I find it annoying that the warning pops up each time reminding me that contents will be lost. I know I can tell it to "not tell me next time" but I still want to keep that warning.