I used to use a Macros in older versions of CorelDraw for my laser cutting files. I use the default black as my cutting colour and magenta as my "drawing" or "kiss-cutting" colour.The macro would change the outlines I selected to magenta with a keyboard shortcut. I would change multiple or single lines with one button click.This was the macros I recorded that worked for previous versions of CorelDraw:
Sub Colour_Change()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
OrigSelection.SetOutlineProperties Color:=CreateCMYKColor(0, 100, 0, 0)
End Sub
I figured maybe they've upgraded to a newer macros language so I rerecorded a new one, but it still doesn't work. This is what it creates when I record the same actions as I did a few years ago: let OrigSelection = host.ActiveSelectionRange; OrigSelection.SetOutlineProperties(-1, null, host.CreateCMYKColor(0, 100, 0, 0));I found a work around where I could create a custom object style and assign the colour to magenta with a keyboard shortcut, but then I have to import the style set file for each document I create. Not the end of the world but I miss the macros that remained on every document I created. Just wondering what I need to do to recreate this macros effectively.
CorelDRAW 2020 supports VBA and JavaScript. When you record a script, you have an option for which language is used for recording.
Check your Scripts docker, and make sure that Visual Basic for Applications is available there.
If VBA is working correctly, you should be able to create a VBA project, create a module in it, and then paste in your old VBA code. When I do that, your code works.
Thank you for your reply. I have VSTA and Javascript in my scripts docker and it only shows Javascript when recording a macros. Should I uninstall Corel and reinstall to get VBA? Would that work?
ukulelegnome said:I have VSTA and Javascript in my scripts docker and it only shows Javascript when recording a macros. Should I uninstall Corel and reinstall to get VBA? Would that work?
You might not have to uninstall.
Try running the Setup program, and then use the option to modify your installation. Installing VBA support should be one of the options.
If that doesn't work, then yes, a full uninstall/reinstall might be worth considering.
That fixed the issue. The VBA box wasn't ticked in the setup, I didn't know what it was when installing last time. Thank you so much.