As a short introduction, a macro is series of commands that automate some task.
In case of Corel Draw it is program written in visual basic programming language.
Macros are stored in files with extension '.gms '. There is one file provided by Corel called globalMacroStorage.gms.
This is first (1) place where you can save your macro.
Second (2) option is to create new file which represents new macro project.
Very basic (simplified) structure of macro project is as follows:
- Project contain: modules
- modules contain: subs (subroutines) in many cases these are actual macros
(You will see later that the structure of project is much more complex)
1) GlobalMacroStorage.gms
Go to: main menu >> Tools >> Macros >> and choose Macro Manager
You should see new pop-up window or docker on the right hand side with the list of all macro projects in it.
Find the 'GlobalMacroStorage' and click the little cross next to see modules.
On the top of this window click 'New' button and then module.
While newly created module is selected repeat operation but this time select macro.
You should see new pop-up window or docker on the right hand side with the list of all macro projects in it.
Find the 'GlobalMacroStorage' and click the little cross next to see modules.
While newly created module is selected repeat operation but this time select macro.
It opens the macro editor where you can write or edit your macro.
Sub nameOfMacro() 'Sub states for subroutine.
'Code here
End Sub
Sub nameOfMacro() 'Sub states for subroutine.
'Code here
End Sub
2) Creating new macro project
The procedure is pretty much the same except your first choice after clicking the 'New' button is 'Macro Project'.
You will be prompt to name and save new .gms file. The dialog box will display right location, which is:
Windows XP: C:\Documents and Settings\'user nick name'\Application Data\Corel\CorelDRAW Graphics Suite X5\Draw\GMS
Windows Vista: C:\Users\'user nick name'\AppData\Roaming\Corel\CorelDRAW Graphics Suite X5\User Draw\GMS
Windows 7: C:\Users\'user nick name'\AppData\Roaming\Corel\CorelDRAW Graphics Suite X5\Draw\GMS
Form there Corel Draw loads your project at start up.
Rest procedure of creating new macro is the same as for 1) GlobalMacroStorage.gms
For the summary see this short video:
The first macro code will be explained in the next post.
Another way to create new macro project is to create simple text file and change it's extension to '.gms', and place it in same location as previous plus alternatively:
Windows XP: C:\Program Files\Corel\CorelDRAW Graphics Suite X5\Draw\GMS
LINKS:
http://www.corel.com/servlet/Satellite/us/en/Content/1175289952188
http://en.wikipedia.org/wiki/Macro_(computer_science)
http://en.wikipedia.org/wiki/Visual_Basic_for_Applications
http://acroe.imag.fr/gms/
http://en.wikipedia.org/wiki/Subroutine
http://www.oberonplace.com/vba/createmacro.htm