Thursday, July 16, 2009

Visual Studio 2008 | Generate GUIDs

Tools -> Macros -> Macros IDE
New Module, and inside the module, paste:

Sub Create_GUID()
DTE.ActiveDocument.Selection.Text = System.Guid.NewGuid().ToString("D").ToUpper()
End Sub

To assign a keyboard shortcut to enable instant GUID pasting:
Tools, Options, "Show All Settings", Keyboard
Write "guid" underneath "show commands containing" and search the previously created macro. Press some keyboard keys in "Press shortcut keys" at "Assign" item.

No comments:

Post a Comment