This documentation is archived and is not being maintained.

VCCodeNamespace Object

Visual Studio .NET 2003

An object representing a namespace element in the source code of a solution.

[Visual Basic .NET]
Public Interface VCCodeNamespace
   Inherits IDispatch
[Visual Basic 6]
Class VCCodeNamespace
interface VCCodeNamespace : IDispatch
public interface VCCodeNamespace : IDispatch
[JScript .NET]
public interface VCCodeNamespace extends IDispatch


The VCCodeNamespace object represents namespace declarations and is a superset of the VCCodeElement object.

Note   A large part of the functionality of this object is provided by the Visual Studio CodeNamespace object. For more information, see CodeNamespace object.


Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll


This example retrieves the namespaces of the current solution and displays each name in a message box.

Sub AllNamespaces()
    Dim codeModel As VCCodeModel
    codeModel = DTE.Solution.Item(1).CodeModel
    Dim namespace As VCCodeNamespace
    For Each namespace In codeModel.Namespaces
End Sub

See Samples for Code Model Extensibility for information on how to compile and run this sample.

See Also

VCCodeNamespace Object Properties, Methods, and Events | Visual C++ Extensibility Object Model