Calling Macros In IDE

  • Thread starter Thread starter Greg Smith
  • Start date Start date
G

Greg Smith

I'm sure there is a way to do this but I can't seem to find it. How do you
assign a key-stroke to a macro so you can call it from the editor?

What I would like to do is type Something-Something-S and have a macro I
created to generate a switch statement be called.

Any help is greatly appreciated.
 
One you record your macro, Select Tools, then Options in the IDE. The,
under the Environment folder (the first one) select KeyBoard. The middle
section will have a listbox with a bunch of stuff like Action.Add right
under a textbox titled Show Commands Containing:


From there, scroll down to your Macro. Macros.MyMacro.SomeNameForIt. You
can add your shortcut from there.

HTH,

Bill
 
Hello Greg,

Thanks for your post. Bill's reply is correct that you can map keyboard
shortcut for your macro in the "Tools" -> "Options" of VS .NET.

In addition, you can also open Macro Explorer under "Tools" -> "Macros" to
execute a macro.

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thanks for your post. Bill's reply is correct that you can map keyboard
shortcut for your macro in the "Tools" -> "Options" of VS .NET.

In addition, you can also open Macro Explorer under "Tools" -> "Macros" to
execute a macro.

Please feel free to let me know if you have any problems or concerns.

Yes, one more question if it is not to much trouble. Does the VS IDE have
feature like Borland's C# IDE (for them it is Ctrl-J) that brings up a pick
list of code templates? I theirs you can Ctrl-J and select the switch
statement for the pick list and it enters a standard switch statement into
your code.
 
Hello Greg,
Ctrl-J) that brings up a pick list of code templates?

By "list of code templates", do you mean the Intellisense for auto code
completion? If so, VS .NET IDE has the same functionality and its shortcut
is also Ctrl+J.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Does the VS IDE have feature like Borland's C# IDE (for them it is
Ctrl-J) that brings up a pick list of code templates?

By "list of code templates", do you mean the Intellisense for auto code
completion? If so, VS .NET IDE has the same functionality and its shortcut
is also Ctrl+J.

No, Not the same. If you Ctrl-J and type s and hit the Enter key the
following code is pasted into your code at the cursor:

switch ()
{
case :
;
break;
case :
;
break;
}

If you Ctrl-J, t, down arrow you get a try catch:

try
{

}
catch (Exception ex)
{

}
finally
{

}
 
Hello Greg,

Thanks for your information. Then, based on my experience, there is no such
equivalent functionality in VS .NET IDE. Sorry.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top