with
this stuff as of late. I had to the get the nodes of the Server Explorer
window, so this should apply to what you are doing. Check out the
following
code. First I get the window, just change that to the Solution Explorer
window enum. Then, you can use the UIHeirarchy model to get the nodes.
Use
the MSDN to understand more about the UIHeirarchy and UIHeirarchyItem
objects. Once you understand those you are on your way. Good luck.
note that on the GetItem function you can separate your nodes using a \
char. This way you don't have to keep getting the object item off of each
node and drilling down to the level you want, you can just get to your
node
directly using this shortcut.
Dim z As EnvDTE.Window =
_applicationObject.Windows.Item(Constants.vsWindowKindServerExplorer)
Dim lssProc As String =
DirectCast(_applicationObject.ActiveDocument.Selection,
TextSelection).Text
Dim lsDB As String =my database name ' as it exists in the server
explorer window
Try
Dim x As UIHierarchyItem = CType(z.Object,
EnvDTE.UIHierarchy).GetItem(String.Concat("Data Connections\", lsdb,
"\Stored
Procedures\", lssProc))
x.Select(vsUISelectionType.vsUISelectionTypeSelect)
CType(z.Object, EnvDTE.UIHierarchy).DoDefaultAction()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try