Outline w/ no Fill Color Crashing CorelDraw | For Each Shape Selected Convert Outline to Object

If there is an independent Outline with no "Fill" color assigned. The code below crashes CorelDraw.

It works as long as a "Fill" color is assigned.

Seems as if it needs the Fill to consider it a shape?

What am I missing?

Sub outlineObjectTest()

Dim s As Shape
Dim sr As ShapeRange

Set sr = ActiveSelectionRange

For Each s In sr.Shapes
     s.Outline.ConvertToObject
Next s

End Sub

Parents
No Data
Reply
  • It's caused crashes since I've used Corel (x5) I recall hitting the same issue when I started writing macros. Still does in 2020 too.

    As bonus says just put an if statement in there to stop it trying to convert a none existent outline

    For Each s In sr.Shapes
         if not s.Outline.Type=cdrNoOutline then s.Outline.ConvertToObject
    Next s

Children
No Data