Ver versión en español    
 
Home
10 Reasons to use MZ-Tools
MZ-Tools 6.0 for VS.NET
Editions
Features
Online Documentation
MZ-Tools SDK
Download
Purchase
Version History (RSS)  
FAQ & Support
MZ-Tools 3.0 for VB6 & VBA
Features
Online Documentation
Download (freeware)
Donations (Paypal)
Version History (RSS)  
FAQ & Support
User Reviews
Community Place
Contact  
For Add-In Developers
About
   
User Testimonials

I'm an avid supporter of MZ-Tools. It's a product I couldn't do without and your level of support is outstanding.

Jan Hyde (Visual Basic MVP)

You will soon wonder how you ever lived without it.

Andy Maggs

More user reviews
 
BUG: UIHierarchyItems.Expanded fails silently from Visual Studio 2005 add-in or macro

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio 2005
Date: May 2006    
       
Introduction

This article explains a problem that happens when a Visual Studio 2005 add-in or macro tries to collapse the nodes of the Solution Explorer.

Cause

This is a bug of Visual Studio 2005.

More Information

Steps to reproduce the problem:

  • Create a new VB 2005 project named "WindowsApplication1" (the solution will have the same name).
  • Save it and show the solution node in the Solution Explorer.
  • Add a new Solution Folder named "NewFolder1".
  • Move the WindowsApplication1 project inside the solution folder, so that the hierarchy is "WindowsApplication1" solution, "NewFolder1" solution folder, "WindowsApplication1" project.
  • Ensure that all nodes in the solution explorer are expanded.
  • Create a Visual Basic 2005 macro as follows which should collapse the node of the project:
Dim colUIHierarchyItems As UIHierarchyItems

colUIHierarchyItems = DTE.ToolWindows.SolutionExplorer.UIHierarchyItems
colUIHierarchyItems = colUIHierarchyItems.Item("WindowsApplication1").UIHierarchyItems
colUIHierarchyItems = colUIHierarchyItems.Item("NewFolder1").UIHierarchyItems
colUIHierarchyItems = colUIHierarchyItems.Item("WindowsApplication1").UIHierarchyItems

colUIHierarchyItems.Expanded = False

If colUIHierarchyItems.Expanded = True Then
   MessageBox.Show("Error")
End If
  • When you run the macro, you get the "Error" message.

Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this


   Top