Previous Document Next Document

Creating macros : Creating macro projects


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
Using GMS files

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.

Macro-project type
GMS folder
Default projects installed with the software
X:\Program Files\Corel\<suite>\<program>\GMS
Legend:
 
X: is the drive and Program Files\Corel\<suite> is the path where the software suite is installed
 
<program> is the program subfolder
User-created projects on Windows 7 and Windows Vista
X:\Users\<username>\AppData\Roaming\Corel\<suite>\
<program>\GMS
Legend:
 
X: is the drive where the software is installed
 
<username> is the name of the user
 
<suite> is the folder where the software suite is installed
 
<program> is the application subfolder
User-created projects on Windows XP
X:\Documents and Settings\<username>\Application Data\Corel\<folder>\<application>\GMS
Legend:
 
X: is the drive where the software is installed
 
<username> is the name of the user
 
<suite> is the folder where the software suite is installed
 
<program> is the program subfolder

Understanding macro projects

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

For details on creating macro projects, see the following procedures:

 
 
 
 

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.