Creating macros : Creating macro projects |
The process of creating a macro begins with creating a macro project. A macro project can be created in one of two ways:
• |
as a Global Macro Storage (GMS), or project, file
|
• |
in a document
|
For best results in storing and distributing a macro project, it is highly recommended that you use a GMS file. GMS files are stored in the GMS folder for the application, the location of which depends on the type of macro project.
The Macro Manager docker provides basic tools for working with macro projects. For access to more advanced tools, you can use the Macro Editor (for VBA macro projects) or the VSTA Editor (for VSTA macro projects).
In the Macro Editor, a VBA macro project is broken into four types of components, which are displayed as the following folders in the Project Explorer (see Using the Project Explorer):
• |
<application> Objects contains a single item that is used mostly for event handling: ThisMacroStorage
for GMS-based macro projects, or ThisDocument for document-based macro projects. For normal code, this
module is not used.
|
• |
Forms contains customized dialog boxes and user interfaces, plus the code to control them
|
• |
Modules contains code modules, for storing general code and macros
|
• |
Class Modules contains object-oriented Visual Basic class modules (which are not discussed in this
documentation)
|
• |
In the Macro Editor, you cannot move a component from one folder to another within the same project.
However, you can drag a component to another project to make a copy of it there.
|
For details on creating macro projects, see the following procedures:
• |
• |
• |
• |
Copyright 2013 Corel Corporation. All rights reserved.