Recording macros

You can record macros from directly within CorelDRAW (that is, without using the VB Editor). Recording a macro creates (in the chosen project) a new VBA macro, which can then be edited and customized by using the VB Editor.

The Save Macro dialog box

You may prefer to create macros by recording if you are not familiar with the application's object model or are not sure which objects and methods to use. For many simple and repetitive tasks, recorded macros are a quick, efficient solution; they store the sequence of keys you press and mouse actions you perform within CorelDRAW, so that you can reuse that sequence in the future.

You cannot record macros in Corel PHOTO-PAINT.

To record a macro

1 Click Tools ► Visual Basic ► Record, or click the Record button a on the Visual Basic for Applications toolbar.

2 From the Store macro in list box, choose the VBA project (GMS) file or CorelDRAW (CDR) file in which you want to store the recorded macro.

3 In the Macro name box, type a name that is unique to the file in which you have chosen to store the macro. Macro names can contain numerals, but they must begin with a letter. Macro names cannot contain spaces or non-alphanumeric characters other than underscores ( _ ).

4 If you want, type a description of the macro in the Description box.

5 Click OK.

CorelDRAW begins recording your actions. To pause or resume recording, click Tools ► Visual Basic ► Pause, or click the Pause button " on the Visual Basic for Applications toolbar.

6 To stop recording, click Tools ► Visual Basic ► Stop, or click the Stop button J on the Visual Basic for Applications toolbar.

The macro is saved using the settings you've specified.

Not all actions can be recorded, some because of their complexity (although many such actions can be manually coded in the VB Editor). When an action cannot be recorded, the following comment is placed in the code: The recording of this command is not supported.

0 0

Post a comment

  • Receive news updates via email from this site