• Increase font size
  • Default font size
  • Decrease font size

Helixoft Blog

Peter Macej - lead developer of VSdocman - talks about Visual Studio tips and automation

Assigning a Keyboard Shortcut to Macro in VS

Last time I forgot to mention one important thing - how to assign a keyboard shortcut to your macro. Often you don’t need any button for your macro, the shortcut is enough. Or you can have both. As I already wrote, macro is similar to any named command. So to assign a shortcut to it:

  1. Go to menu Tools - Options… and select Environment - Keyboard.

    Keyboard options in Visual Studio

  2. Find your macro in the list of commands. All macro names start with “Macro.”. To filter out other commands enter your macro name in the Show commands containing field. If your macro is named test as in our example then type test. Select your macro.
  3. Go to Press shortcut key(s) field and press your shortcut. If the shortcut is already in use, you will see it. Press Assign button.

    Remember that you cannot change or assign the shortcut if you are using predefined keyboard mapping scheme. You will be warned in this case. You must create a copy of current scheme and use that copy. Press Save As… button under Keyboard mapping scheme and give it some name. Then select this new scheme.

2 Responses to “Assigning a Keyboard Shortcut to Macro in VS”

  1. srikanth:

    yes i can read the code

  2. savita:

    Great!! Its really very much time saving!!!… Thanks

Leave a Reply

authimage

Can't read the code? Try reloading the page before adding your comment to get a new code image.

VSdocman

Document your .NET code on professional level.

XML comments - MSDN Help and IntelliSense

Create MSDN-like class documentation with IntelliSense and F1 context sensitive help for your Visual Basic .NET and C# projects. See how easy the code commenting can be with powerful comment templates and sophisticated WYSIWYG comment editor.

More... | Download