共用方式為


How to Use Macro Code

To use the macro code you find here you'll want to copy it to the clipboard and follow these steps.

Getting the macro into Visual Studio .Net

  1. Open Visual Studio .Net
  2. Use the menu to view Tools->Macros->Macro Explorer or Alt-F8 with most profiles.
  3. Right click to create a new macro project or open an existing module for editing.
  4. Paste the macro code you had in the clipboard into the module

Using the Macro

  1. Open the Macro Explorer
  2. Browse into the Module that contains your macro.  You should also have a bunch of sample macros installed by default.
  3. Double click on the macro you want to run.
  4. or create a menu item and key combination for your macro by....

Putting a Macro on a Menu or Command Bar

  1. Open Tools->Customize.
  2. Switch to the Commands tab.
  3. In the categories pane select macros.
  4. Drag the macro onto a menu or command bar.
  5. Once it is on a menu or command bar you can highlight it (with the Customize dialog still open)
  6. Click “Modify Selection“.
  7. From here you can Change the name or button image that goes with it.

Creating a Keybinding for your Macro

  1. Open Tools->Options->Environment->Keyboard.
  2. Enter your macro name in the “Show Commands Containing“ textbox.
  3. Put the cursor in the “Press Shortcut Key(s)“ textbox.
  4. Enter your key a key combination.