Found this:
Sub SurroundWithAppendTag()
DTE.ActiveDocument.Selection.Text = ".Append(""" + DTE.ActiveDocument.Selection.Text + """)"
End Sub
But I can't seem to figure out how to 开发者_如何学Cloop through each line of text in the selection. Any thoughts?
Simple:
Dim lines = DTE.ActiveDocument.Selection.Text.Replace(vbCrLf, vbLf).Split(vbLf)
The rest is up to you...
精彩评论