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
 
HOWTO: Getting properties from the DTE.Properties collection of Visual Studio .NET.

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio .NET 2002
Date: September 2005   Microsoft Visual Studio .NET 2003
      Microsoft Visual Studio 2005
Introduction

This article describes how to get properties from the DTE.Properties collection from a Visual Studio .NET add-in or macro.

More Information

Visual Studio .NET provides many options to customize it through the "Tools", "Options" menu. In this Options window you can select a category (folder) and a page (node) in the left part of the window and then the properties for that page are displayed to the right. When you need to set or get a property value programmatically, you have to use the EnvDTE.DTE.Properties method, which returns an indexed EnvDTE.Properties object. The EnvDTE.DTE.Properties method receives two string parameters: the category and the page, whose values may be difficult to guess for a given the property. There are two ways to get the category and the page for a property:

  • To read the Visual Studio .NET documentation about DTE.Properties, which is located at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfdtepropertiescollections.asp

  • To use regedit.exe tool to search in the Windows registry the categories, pages and property names, which are located at:

For Visual Studio .NET 2002: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\AutomationProperties
For Visual Studio .NET 2003: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AutomationProperties
For Visual Studio 2005: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\AutomationProperties

Under that registry key, there are categories (the first argument of DTE.Properties) such as "Environment", "FontsAndColors", "Projects" or "TextEditor". Inside the registry key for each category there are page names (the second argument of DTE.Properties). For example, the "Environment" category has the pages "Documents", "General", "Help", etc.

Notice that the user interface provided by the Options window may arrange categories, pages and options in a different way than the information stored in the registry.

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

MZ-Tools 6.0 for Visual Studio .NET

You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:

Buy MZ-Tools Now Download MZ-Tools Demo

   Top