Creating a Macros Toolbar
Creating a toolbar for macros in Visual Studio .NET is exactly like creating a macros toolbar in an Office application.The first step is to right-click on the Visual Studio .NET toolbar area to get the list of available toolbars. Then select Customize, as Figure 16.12 demonstrates.
Figure 16.12. The Toolbars menu.

After you click Customize, the Customize dialog pops up. Click the New button, and type Utilities in the input box, as Figure 16.13 shows.
Figure 16.13. Adding the Utilities toolbar.

After you add the new toolbar, you'll see an empty toolbar next to the dialog box. Click the Commands tab on the Customize dialog. On the left Categories pane, scroll down until you see Macros. Select Macros, and you'll see the Macro projects listed in the Commands list box.Scroll down in the Commands list box until you see the Utilities.VSMacros project that all your macros are in. Figure 16.14 is what you should see on your screen.
Figure 16.14. Finding the Utilities.VSMacros commands.

When you see the commands, drag the items to the new toolbar as shown in Figure 16.15.
Figure 16.15. Adding commands to the new Utilities toolbar.

Because the descriptions are too long to be logical, you can right-click each item in the toolbar, and change its name to something less wordy. Notice that you can also add an icon to your toolbar item using the contextual menu.Figure 16.16 shows my completed toolbar with an icon on the GetDocumentInfo2 macro, as well as the automatic tooltip that's provided by the IDE.
Figure 16.16. The completed Macro toolbar in action.

So, your work has come full circle: You created a macro using the recorder, rewrote it using the objects in the DTE class, and finally you created a toolbar to access your macros faster than going to the Macro Explorer.
• Table of Contents
• Index
Sams Teach Yourself Visual Studio® .NET 2003 in 21 Days
By
Jason Beres
Publisher
: Sams Publishing
Pub Date
: January 14, 2003
ISBN
: 0-672-32421-0
Pages
: 696
Sams Teach Yourself Visual Studio .NET in 21 Days will help developers that are new to application development and experienced developers understand how to use the .NET Framework and Visual Studio .NET to rapidly develop any type of computer application. The Visual Studio .NET development environment is the most comprehensive developer tool ever created, putting that together with the .NET Frameworks' Class Libraries, the developer has everything he or she needs to get up-to-speed on Microsoft's latest revolution in application development. This book will guide the developer through using the VS .NET IDE, the Visual Basic .NET and C# language, and the supporting tools available from Microsoft to create Windows and Web-based applications. The market is full of books that pretty much say the same thing, which is already available in the help files, the author of this book has written and deployed over a dozen successful applications using Visual Studio .NET and the .NET Framework. All of his expertise and experience is used to give you the most comprehensive title on using Visual Studio .NET.