Sub outline_object_closed() Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange Dim s1 As Shape Set s1 = OrigSelection(1).Outline.ConvertToObjectEnd Sub
When I try that code, I find that it consistently crashes CorelDRAW if the object has no outline.
Are you seeing it crash sometimes when there is an outline?
it will crash even with an outlined object. I got this code from the record function and it's weird that it works in the normal function of the menu drop down but not as a macro. I found this code works just fine.
Dim sr As ShapeRange, sh As ShapeSet sr = ActivePage.Shapes.All For Each sh In sr If Not sh.Outline.Type = cdrNoOutline Then sh.Outline.ConvertToObject End If Next
It isn't surprising that the second code might avoid a problem - because it will never try to use Shape.Outline.ConvertToObject on a shape that has no outline!