Tuesday, June 1, 2010

Collapse & Expand Code

When I use Visual Studio IDE to edit an XML file, I often come accross a big tree that is not easily to find my way out. So I start to collapse the expanded nodes. Unfortunately it might be very hard to do this.
So I was looking for a macro to do it and found the following macro which I attached a toolbar icon to it:


'' Toggle the current row and go down one line
Sub ToggleOne()
Dim cmd As String = "Edit.ToggleOutliningExpansion"
Dim ts As TextSelection = DTE.ActiveDocument.Selection

DTE.ExecuteCommand(cmd)
ts.LineDown()

End Sub

No comments: