views:

16

answers:

0

I have a Wrap Append macro that basically wraps SQL in a .Append tag:

Public Module WrapAppend

    Sub SurroundWithAppendTag()
        Dim lines = DTE.ActiveDocument.Selection.Text.Replace(vbCrLf, vbLf).Split(vbLf)
        For Each line As String In lines
            DTE.ActiveDocument.Selection.Text = ".Append(""" + line + """)"
            DTE.ActiveDocument.Selection.NewLine()
        Next
    End Sub


End Module

I ran this yesterday for a quite large SQL statement, and now my solution is strangely slow. Each subsequent run of this macro on the same code behind is slower and slower. Do I need to clear something?