| < Free Open Study > |
|
If, for some reason, you would like to open all of the code and designer windows in the project, the following procedure will do that for you. It does not open the AssemblyInfo.vb file because you would not normally change this file.
Sub OpenAllWindows() Dim pi As ProjectItem Dim prj As Project Dim sln As String = DTE.Solution.Item(1).Name On Error Resume Next For Each prj In DTE.ActiveSolutionProjects For Each pi In prj.ProjectItems 'Debug.WriteLine(pi.Name) If pi.Name.ToUpper.EndsWith(".VB") And _ pi.Name.ToUpper <> "ASSEMBLYINFO.VB" Then Dim pn As String = prj.Name Dim s As String = pi.Name.ToString ' GetType(Sln.Name\proj.name\prjItem.name) Dim s2 As String = sln & "\" & pn & "\" & s DTE.Windows.Item(Constants. vsWindowKindSolutionExplorer). Activate() DTE.ActiveWindow.Object.GetItem(s2).Select( vsUISelectionType.vsUISelectionTypeSelect) DTE.ActiveWindow.Object.DoDefaultAction() 'System.Windows.Forms.Application.DoEvents() Dim doc As Document = DTE.ActiveDocument() End If Next Next End Sub
| < Free Open Study > |
|