Skip to Main Content
Professional Visual Studio® 2008
book

Professional Visual Studio® 2008

by Nick Randolph, David Gardner
July 2008
Intermediate to advanced content levelIntermediate to advanced
1026 pages
27h 59m
English
Wrox
Content preview from Professional Visual Studio® 2008

53.5. How to Develop a Macro

Developing a macro with programming code is an easy task. You just write your code and debug it and don't need to worry about compilation and other stuff. You may notice that macro development is easier in comparison with other development scenarios like developing an add-in or a Windows application.

However, macro development applies your knowledge in object-oriented programming by using concepts like classes, modules, and methods to build a macro.

You can even use user interface elements like Windows Forms in your macros. This isn't a common scenario, but it can be done easily. As with a normal project, you add a reference to Windows Forms assemblies in your macro project, then add Windows Forms to your project and load them in your code. However, here we won't get into details about this here.

The best way to understand the development process is by seeing an example. Here you see an example that is a built-in part of Visual Studio. The accessibility module located in the Samples macro project that comes with the default Visual Studio installation is a module that contains a few macros to improve the accessibility of the Visual Studio IDE by changing the size of fonts and their colors. The code for this module is shown here:

Imports EnvDTE Imports System Imports EnvDTE80 Imports System.Diagnostics Imports Microsoft.Win32 Public Module Accessibility Private Const fontSizeIncrement As Integer = 2 Private Const minimumSupportedEditorSize As Integer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional Visual Studio® 2010

Professional Visual Studio® 2010

Nick Randolph, David Gardner, Michael Minutillo, Chris Anderson

Publisher Resources

ISBN: 9780470229880Purchase book