Previous Document Next Document

Understanding automation : What is automation?


What is automation?

Many actions that you perform in the software can be combined with other, related actions into a single automated solution. Automating repetitive tasks saves time, reduces effort, and lets you perform operations that are too complex to perform manually.

Automation can be used by programmers and nonprogrammers alike.

 
This documentation does not teach programming skills to nonprogrammers; rather, it helps experienced programmers develop useful solutions within the software. If you are not a programmer, you may want to refer to other programming-related resources before continuing to read this documentation.
What is a macro?

Most macros are created to automate a series of tasks within an application. The simplest meaning of the term “macro” is the recording of a group of related actions that can be played back automatically, in sequence, whenever you need to perform them. Macros consist of instructions that are written in a programming language, and some programming languages provide access to additional, more advanced, actions that cannot be recorded.

 
For the purposes of this documentation, a macro refers to a coded solution that performs tasks in the application by automating functions and subroutines (see Using functions and subroutines).

Although you can record a sequence of actions in the software, the real power of automation is that you can add conditions and looping mechanisms to a recording. As an example, let’s consider a simple macro that applies a red fill and a 1-point outline to a selected shape. By adding a condition and a looping mechanism to the code, you can produce a macro that seeks out each selected shape and applies only the fill to text shapes and only the outline to all other shape types.

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 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.

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.