Microsoft Office Tutorials and References
In Depth Information
The macros you create are stored in the global template by default, so they are available
to you whenever Project is running. The plan for which you originally created the macro
need not be open to run the macro in other plans. You can also use the Organizer to copy
macros between plans. For example, you can use the Organizer to copy the VBA module
(which contains the macro) from the global template to another plan to give it to a friend.
What kinds of repetitive activities might you want to capture in a macro? Here’s one
example. Creating a graphic-image snapshot of a view is a great way to share project details
with others. However, it’s likely that the details you initially capture will become obsolete
quickly as the plan is updated. Capturing updated snapshots can be a repetitive task that is
ideal for automation through a macro. When this task is automated, you can quickly
generate a new GIF image snapshot of a plan and save the GIF image to a file. From there, you
could attach the GIF image file to an email message, publish it to a website, insert it into a
document, or share it in other ways.
The scenario: At Lucerne Publishing, you frequently generate a GIF image snapshot of a
plan for sharing with the team. You’d like to automate this task.
In this exercise, you record and run a macro.
On the View tab of the Customizing A plan, in the Macros group, click the down
arrow below the Macros button, and then click Record Macro .
The Record Macro dialog box appears.
In the Macro name box, type Capture_GIF_Image .
TIP Macro names must begin with a letter and cannot contain spaces. To improve
the readability of your macro names, you can use an underscore (_) in place of a
space. For example, rather than naming a macro CaptureGIFImage , you can name
it Capture_GIF_Image .
For this macro, we will not use a shortcut key. When recording other macros, note
that you cannot use a Ctrl+ combination that is already reserved by Project, so
combinations like Ctrl+F (the keyboard shortcut for Find) and Ctrl+G (Go To) are
unavailable. When you close the dialog box, Project alerts you whether you need to
choose a different key combination.
In the Store macro in box, click This Project to store the macro in the active plan.