Managing Macros
Macro Explorer is your primary tool for tracking and managing macros. It is a window in the main Visual Studio .NET integrated development environment (IDE) and can be viewed by pressing ALT+F8. For details about the various parts of Macro Explorer, see Macro Explorer Window.
The primary tasks associated with managing macros are:
- Creating new macro projects and modules.
- Loading and unloading existing macro projects.
- Deleting macro projects and modules.
- Renaming macro projects, modules, and commands.
- Editing a command or module
For all of the following tasks, press ALT+F8 to display Macro Explorer if it is not already displayed.
To create a new macro project or module in the Macro Explorer
- To create a new macro project, right-click the Macros node and choose New Project.
Note Macro projects can be created only in Macro Explorer. You cannot create macro projects in the Macros IDE.
- To create a new macro module, right-click a project and choose New Module.
To load an existing macro project in the Macro Explorer
- Right-click the Macros node and choose Load Project.
- Browse to the macro project file and then choose Open.
To unload a macro project from the Macro Explorer
- Right-click the macro project you want to unload and choose Unload Project.
Note When a project is unloaded, its security settings are lost. For more information, see Macros Security and Sharing Issues.
To delete a macro module or command from Macro Explorer
Select the item and press DELETE.
—or—
Right-click it and choose Delete.
Note Delete the project file by using Windows Explorer.
To delete a macro project from Macro Explorer
- Right-click it and choose Unload.
Note Delete the project file by using Windows Explorer.
To rename a macro project, module, or command
To rename a macro project, module, or command, right-click it and choose Rename.
Type the new name and press ENTER.
Note Renaming modules affects module declarations in files, but renaming projects does not affect the default namespace. Also, if you rename a macro project, module, or command in the Macros IDE, the changes will not be reflected in Macro Explorer or Project Explorer. Macro references are still based on the namespace declared in the modules, which can compile errors if you attempt to refer to macros based on the new project name.
For information about how to edit a macro module or command, see Editing Macros.
Storage Formats and Locations for Macros
You can save macros as either binary or text files. Binary is the default format for macros and uses the .Vsmacros extension. You can also choose, however, to save the macro as Unicode text (.txt).
Saving a macro as a binary file makes it convenient to distribute several macros in a project as a single file. Saving a macro as a text file enables you, for example, to open the file outside of Visual Studio .NET, copy a single command from it, and then e-mail it to someone.
By default, macros are stored in \VSMacros in the directory specified in the Projects and Solutions node under the Environment node of the Options dialog box. You can, however, change the Visual Studio .NET project location path in the Options dialog box, or press CTRL+E to export the macro to another location.
See Also
Automating Repetitive Actions by Using Macros | Recording Macros | Running Macros | Editing Macros | Debugging Macros | Macro Recording and Running Issues | Referencing COM and .NET Framework Components in Macros | Macros and the EnvironmentEvents Project Item | Macros Security and Sharing Issues | Macro Explorer Window