If I assign this code to run via button press in a form, it will crash coreldraw. I still don't understand why that happens and if there is a way to run this code with a button.
Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange Dim s1 As Shape Set s1 = OrigSelection(1).Outline.ConvertToObject
grogo said:If I assign this code to run via button press in a form, it will crash coreldraw. I still don't understand why that happens and if there is a way to run this code with a button.
I tried your code, launched by a command button in a userform, and it didn't crash 2019 for me.
It works for me as well. I just need to put in an error handling deal (On error, resume next and whatnot)
If you draw a rectangle, apply an outline, then click the button the convert the outline to object. Now click on the button again while the object is still selected and BOOM. crash. If by some weird chance there is no outline, the program freaks out.