Skip to content

Instantly share code, notes, and snippets.

@vcsjones
Created May 11, 2012 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcsjones/2659633 to your computer and use it in GitHub Desktop.
Save vcsjones/2659633 to your computer and use it in GitHub Desktop.
LDP GUID Fixer
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Imports System.Text
Public Module EditorMacro
Sub LDPGuidToSSGuid()
Dim selection As EnvDTE.TextSelection
Dim startPoint As EnvDTE.EditPoint
Dim endPoint As TextPoint
Dim commentStart As String
selection = DTE.ActiveDocument.Selection()
startPoint = selection.TopPoint.CreateEditPoint()
endPoint = selection.BottomPoint
Dim peices = selection.Text.Split("-"c)
Dim builder As New StringBuilder()
For i As Integer = 0 To peices.Length - 3
Dim peice As String = peices(i)
For j As Integer = peice.Length - 2 To 0 Step -2
builder.Append(peice.Substring(j, 2))
Next
Next
builder.Append(peices(peices.Length - 2))
builder.Append(peices(peices.Length - 1))
selection.Text = builder.ToString().ToUpper()
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment