
206
|
Chapter 6, Speed Hacks
#52 Generate Code with Macros
HACK
installed), the macros from your own projects will appear. Select the macro
you want to create a button for and drag it into the desired position on the
toolbar where it will appear as a button.
After creating your toolbar, you can simply close the customization window
and dock the toolbar wherever it is convenient for you in your IDE. For
more information on customizing this toolbar, including how to create an
image for your toolbar item, please refer to “Customize Menus and Tool-
bars”
[Hack #25].
Creating a Keyboard Shortcut
Creating a keyboard shortcut is an even easier way to make your macro
accessible during your normal document editing. A macro will simply
appear as another command in the list available when assigning a keyboard
shortcut as described in “Create Your Own Shortcuts”
[Hack #24].
Sharing Macros
Unlike normal Visual Studio Projects, Macro Projects are contained in a sin-
gle file instead of a separate file for each module. If you have a module you
wish to share among multiple users, you must first export it. Here is the pro-
cess for exporting a macro:
1. Open the module you wish to export.
2. Click File
➝ Export NewModule (Ctrl-E).
3. Choose where to save the file to.
When you wish to import the module on another machine, simply select
Add Existing Item and locate the file you previously exported.
See Also
• “Generate Code with ...