What is a Macro?
A macro is simply a programmed set of instructions that tell Word what it should do. Macros are
written or recorded in a procedure, otherwise known as a routine.
How are Macros Created?
Word offers two main ways of creating macros. Macros can be recorded using the built-in macro
recorder, which records what you do and then converts this into a macro program. This is a great
way of creating macros for performing routine, complex or boring and repetitious tasks. Once
recorded, these tasks can be performed quickly over and over again by running the macro.
Macros can also be developed from scratch. In other words, you can type the programming steps
yourself rather than recording them using the built-in macro recorder.
What Types of Macros Are There?
There are two types of macro – global and local.
A global macro is available to all documents. For example, you may have a macro that adds your
company name and file details to the footer. Since you want all documents to have this, the macro to
add the footer should be available to all documents and would therefore need to be a global macro.
A local macro is only available to a particular document or template. For example, you may have a
monthly report document that needs to have information imported into it from other sources. You can
set up a macro that will import for you so that you don’t have to perform the steps each time.
Where Are Macros Located?
Macros are located in special macro sheets attached to either a document or template. Local
macros, because they pertain to one document, can be found in the macro sheet for that document.
Global macros are stored in the macro sheet for the Normal template. This then makes them
available to all documents based on that template.
Some advanced users store a collection of routines (macros) in a template and then attach that
template to documents where those macros are required.
How Do You Access Macros?
Macros can be created, viewed and edited using the various macro commands on the Code group
of the Developer tab. If you cannot see the Developer tab, you will need to add it to the Ribbon.
This is done by customising the ribbon in Word Options to display the Developer tab.
Macros can only be viewed using the Visual Basic Editor which is accessed by clicking on Macros
on the Developer tab or by pressing +
.
What is VBA?
VBA (Visual Basic for Applications) is the programming language used to create macros. Earlier
versions of Word used a more primitive version of this language known as WordBasic. VBA is a
common programming language found in virtually all Microsoft Office applications. Once you have
learned it for one product, you can easily adapt what you’ve learned to the other products.
Do I Need to be a Programmer to create Macros?
Absolutely not! While macros may appear cryptic and difficult to understand at first, tools such as the
macro recorder make creating macros easy and effortless.