0

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 loop through each line of text in the selection. Any thoughts?

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
jlrolin
  • 1,604
  • 9
  • 38
  • 67

1 Answers1

2

Simple:

Dim lines = DTE.ActiveDocument.Selection.Text.Replace(vbCrLf, vbLf).Split(vbLf)

The rest is up to you...

Paulo Santos
  • 11,285
  • 4
  • 39
  • 65