When I work with WiX source code I need to create lots of GUIDs. In my Visual Studio 2005 editor all I need to do is to press Alt+G and new GUID magically appears at the cursor. Achieving this is very easy:
- Open Macros IDE by selecting Tools | Macros | Macros IDE.
- Create new macro:
- Bind new macro to Alt+G keyboard shortcut. Open Options dialog, select Environment, then Keyboard on the left. Type “InsertGuid” to locate the macro you just created. Assign Alt+G to it.
Fortunately, no standard command is assigned to Alt+G by default.
Public Sub InsertGuid()
DTE.ActiveDocument.Selection.Text = Guid.NewGuid().ToString()
End Sub