This documentation is archived and is not being maintained.

VCCodeImport Object

Visual Studio .NET 2003

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

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


The VCCodeImport object represents a #import code statement in a source file, allowing access to information about the specific code element.


Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll


This example retrieves the first VCCodeImport object of the current solution and displays it in a message box. It assumes that a C++ project containing a #import statement is open.

Sub GetFirstImport()
    Dim vcCM As VCCodeModel
    Dim vcImport As VCCodeImport
    vcCM = DTE.Solution.Item(1).CodeModel
    vcImport = vcCM.Imports.Item(1)
End Sub

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

See Also

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