5,448,104 members and growing! (15,489 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » .NET Framework » How To     Beginner License: The Code Project Open License (CPOL)

How To Get the Most Out Of Macros

By Amol M Vaidya

Here, I will explain some of the best ways to get the most out of the macros in Visual Studio.
Windows, .NET 1.1, .NETVisual Studio, VS.NET2002, VS.NET2003, VS2005, Dev

Posted: 27 Sep 2007
Updated: 27 Sep 2007
Views: 4,495
Bookmarked: 5 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
8 votes for this Article.
Popularity: 2.06 Rating: 2.28 out of 5
4 votes, 50.0%
1
2 votes, 25.0%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
2 votes, 25.0%
5

Introduction

We all know that macros are a programmers "Donkey". Most of the redundant tasks should be converted to macros. Here, I will show a simple way to get a little bit more out of these macros. Assigning hot keys / keyboard shortcuts to your favourite macros can save you a lot of time.

Imagine you have to get the sliding Macro Explorer into view everytime you wish to run a macro. Trust me, this is painful on most slow machines (which incidentally happen to be many.... especially those allotted to programmers).

Background

I will not go into the details of recording or creating a macro. I will concentrate only on making them much more accessible.

The Scenario

Like many others, I love the macro facility in Windows applications. It makes life a lot easier. Let's consider a scenario wherein we are coding in Visual Studio.

I have many macros in my kitty. Everytime I need to run a macro, I call for the Macro Explorer (Alt + F8). Here I just double click on the required macro and it is executed.
To improve my efficiency, I decide to assign some hot key to my favourite macro.

Here is how I can do it. In Visual Studio, click on Tools -> Options.

The options dialog is displayed. Here click on Keyboard. This is what it will be like:

Screenshot - optionsbox1.jpg

Screenshot - optionsbox2.jpg

I have numbered the important controls in the above dialog.

  1. Keyboard - This lets you select the current keyboard mapping and also allows you to make changes in the current mapping.
  2. Select Macro / Functionality (You can also use the textbox above it to filter out the list)
  3. Current shortcut for the selected Command. (You can remove it by clicking the Remove button alongside)
  4. This defines the scope of the shortcut. (Visual Studio has many windows and you might want your shortcuts only when specific windows are in focus)

    Screenshot - UseShortCutin.jpg

  5. Here you can define your new shortcut key. Just press the combination of keys that you want to use. Don't forget to press Assign for it to take effect.

    Screenshot - Assign.jpg

  6. You can also save your configured keyboard mapping with some other name. Click on Save As and provide a name.
  7. All good things come to an end. If you goofed up a lot, just revert back to the default settings. Here you can select your currently applied keyboard mapping.

That's all, when you want to execute your favourite macro, just reach for the defined keyboard shortcut.

History

  • 28th September, 2007: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Amol M Vaidya


My computer career started as an Avid Gamer Smile. I loved the old times Xatax and Wolf. But, curiosity took over my gaming side and I started to search on ways to create all the mesmerising programs that I used.
I started programming in Qbasic and then moved on to every possible programming language I could lay my hands on. Qbasic, Pascal, C, C++, Win32 SDK, VB 6.0, VB.NET, C#, Struts, Core Java, Javascript, VbScript, Unix Shell Programming, SQL SERVER PROGRAMMING, WMI scripting....are some of the languages I can boast of being proficient in.
My formal introduction to computers was when I took the Bachelor of Computer Sciences (Pune, India) degree.Later on I got Masters from the same university.
My Professional Certifications include
MCP SQL Server 2000 (70-229)
Brainbench Certified MS SQL Server Programmer
Brainbench Certified MS SQL Server Administrator
Brainbench Certified ASP.NET Programmer
Brainbench Certified Javascript Programmer
Brainbench Certified RDBMS Concepts

Currently I am working in Japan. Unofficially, My programming experience is now 7+ years.
Occupation: Web Developer
Location: India India

Other popular .NET Framework articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 2 of 2 (Total in Forum: 2) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralHow to get most out of your articlesmembermrchief_200010:44 26 Dec '07  
GeneralRe: How to get most out of your articlesmemberAmol M Vaidya17:32 3 Mar '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 27 Sep 2007
Editor: Deeksha Shenoy
Copyright 2007 by Amol M Vaidya
Everything else Copyright © CodeProject, 1999-2008
Web18 | Advertise on the Code Project