1. Computing & Technology

Discuss in my forum

Visual Studio Macros

Visual Basic for the Visual Studio IDE

By , About.com Guide

Updated December 21, 2008

Starting with Visual Studio 2003, the tradition of macro programming has been restored to Microsoft's development technology.

Visual Studio macros are Visual Basic programs that automate the work that you can do inside Visual Studio. You can add your own utility functions to do things like menu selections, keyboard entries and so forth. These programs can then be stored and recalled with a single command or keyboard stroke.

This is another area where Microsoft lets you know that Visual Basic remains the top developer language. Macros are written in VB.NET, not some other language, and there isn't any other choice.

But a VS macro can also be a lot more than just a series of commands. Macros can take full advantage of the .NET Framework. Visual Studio also has its own automation object model which includes the ability to debug the macro.

The bad news is that 'Express' editions don't support macros. They had to leave something out of VB.NET Express or nobody would buy the full version of Visual Studio!

On the next page, we write a first macro to get started!

©2012 About.com. All rights reserved.

A part of The New York Times Company.