Macros are a series of consolidated commands that can be launched as one unit, typically through a key combination. As such, they are a huge productivity booster. You might use a macro, for instance, to automatically insert comments into your code, rearrange the windows within the IDE, or report on code statistics. Because macros can be wired into the extensibility object model, there are a host of functions accessible to you via macros. The Macro Explorer, shown in Figure 5.16, is a tree-view window that exposes the list of macros within a solution. Figure 5.16. The Macro Explorer.
The Macros Root NodeThe Macros root node has shortcut menu items for loading existing macro projects, creating a new macro project, or launching the Macros IDE. The Macros IDE is covered in depth in Chapter 11, "Writing Macros, Add-ins, and Wizards." Underneath the Macros root node, child nodes are organized hierarchically in the following fashion: projects modules macros. ProjectsA macro project is a logical and physical container for macros that can span a variety of different functions and intents. The projects themselves are physically stored as a .vsmacros file. By default, macro projects reside within a separate VsMacros subdirectory within the Visual Studio projects directory. At the projects level, you can
If the Set as Recording Project option is selected, macros will be recorded into the selected project. ModulesA module is a logical grouping of macros, typically used to store related macros. You might, for instance, create a module called FileUtilities to store macros designed to help with file management. With the module shortcut menu, you can
MacroThe macro is analogous to a function. Right-clicking on the macro enables you to
|