This documentation is archived and is not being maintained.

VCCodeUnion Object

Visual Studio .NET 2003

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

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


The VCCodeUnion object is used to modify an existing union construct.


Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll


This example displays the name of each union code element in the current solution. It assumes a C++ project is open and that it has global unions.

Sub GetAllUnions()
    Dim vcCM As VCCodeModel
    Dim vcUnion As VCCodeUnions
    vcCM = DTE.Solution.Item(1).CodeModel
    For Each vcUnion in vcCM.Unions
End Sub

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

See Also

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