Understanding automation 6
After you create a macro, you can ensure that it has the desired outcome by setpping through its code one line a
a time, or “debugging” it. When you are happy with the macro, you can keep it for future use and even share it
with others.
Which sample macros are available?
The software includes sample VBA macros, which supply additional functionality, demonstrate automation in
the suite, and provide sample code.
The following sample VBA macros are included for Corel DESIGNER:
•File converter (FileConverter.gms) — converts a vector or bitmap to a specified vector or bitmap format.
You can choose export parameters by using dialog boxes associated with particular filters. You can also save
each page as a separate file and set various page properties, such as size, orientation, and background color.
The following file formats are supported: AI, BMP, CDR, CGM, CMX, CPT, DES, DSF, DXF, EPS, GIF,
JPEG, PCT, PNG, PPF, SVG, SWF, TIF, WMF, and WPG.
The following sample VBA macros are included for CorelDRAW:
•File converter (FileConverter.gms) — converts a vector or bitmap to a specified vector or bitmap format.
You can choose export parameters by using dialog boxes associated with particular filters. You can also save
each page as a separate file and set various page properties, such as size, orientation, and background color.
The following file formats are supported: AI, BMP, CDR, CGM, CMX, CPT, DSF, DXF, EPS, GIF, JPEG,
PCT, PNG, PPF, SVG, SWF, TIF, WMF, and WPG.
• Calendar wizard (CalendarWizard.gms) — generates customized calendars. You can choose the date range,
layout, font, color, language, and many other options. You can also add holidays and moon phases.
The following sample VBA macro is included for Corel PHOTO-PAINT:
• HTML slide show creator (Slideshow.gms) — generates an HTML slide show from the images you specify.
Open files can be added, ordered, and published as a series of HTML files, each of which displays one image
and provides navigation buttons. You can create a title, alternate text, and a name for each slide. You can also
choose a location and a name for the delineation folder; select the image folder; and specify notes, a caption, a
URL, and more.
Which automation environments are supported?
For CorelDRAW versions 6 through 9, the only method of automating tasks was using the Corel SCRIPT™
language. Solution developers used Corel SCRIPT to create intelligent mini-applications for drawing shapes,
repositioning and resizing shapes, opening and closing documents, and setting styles within CorelDRAW.
Although the Corel SCRIPT language was useful for automating basic tasks, a more flexible and powerful
solution became necessary. For version 10, CorelDRAW was enhanced with support for the
Microsoft Visual Basic for Applications (VBA) engine, which handled behind-the-scenes automation. The
addition of VBA made CorelDRAW immediately accessible to millions of VBA and Microsoft Visual Basic (VB)
developers around the world. Since then, VBA has been supported by every version of the CorelDRAW software
suite.
More recently, the software suite added support for Microsoft® Visual Studio® Tools for Applications (VSTA),
the successor to VBA.
Currently, the software suite supports VBA version 6.4 and VSTA version 2.0.