开发者

Visual Studio Macros: Loop through Selection, add .Append(" and ") to each line in selection

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜