View Single Post
Old 05-10-2004, 00:24
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: Run a macro at startup with Corel 12 ?

Originally Posted by -=HKLC=-
How to run a macro at startup with Corel 12 ?
Ok, this question comes up every now end then and I decided to answer it with some pictures

What you need to do is:

1. Start VBA editor by hitting Alt-F11 in CorelDRAW.
2. On the left hand side you'll see project explorer window. Locate "GlobalMacros (GlobalMacros.gms)" module.
3. Expand it until you see ThisMacroStorage under CorelDRAW 12 Objects.
4. Double-click on the ThisMacroStorage item and this will bring up the code window on the left (see the first picture in the attachment).
5. On top of the code window you'll see two list boxes. From the left list select "GlobalMacroStorage" (see Pic 2).
6. In the right list select "Start" event (see Pic 3).
7. This will add a new even handler for application Start event which is called when the application launches. (see Pic 4).
8. Add some code to that even handler. I added just a message box to indicate when the event is called (Pic 5).
9. Now to ensure that the even is called as soon as CorelDRAW starts, you need to make sure VBA is initialized at startup (which is not the default behavior). Go to Tools>Options>Workspace>VBA and at the bottom of the dialog, remove the checkbox from "Delay Load VBA". (Pic 6)

Now you should be all set.
Attached Images

Last edited by Alex; 07-11-2006 at 10:39.
Reply With Quote