Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

ItemName Property

Visual Studio .NET 2003

Returns the name of the current item in the collection.

[Visual Basic .NET]
Public ReadOnly Property ItemName() As String
[Visual Basic 6]
Property Get ItemName() As String
HRESULT __stdcall get_ItemName(
   /* [out, retval] */ BSTR* retVal
public string ItemName {get;}
[JScript .NET]
public function get ItemName() : String


The following sample code uses ItemName property in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim mycollection As IVCCollection
        Dim file As VCFile
        Dim prj As VCProject
        prj = DTE.Solution.Projects.Item(1).Object
        mycollection = prj.Files
        'mycollection.Count has count of files
        file = mycollection.Item(1)
        ' file.ItemName has file name
    End Sub
End Module

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

See Also

Applies To: VCActiveXReference Object | VCAssemblyReference Object | VCFile Object | VCFilter Object | VCProject Object | VCProjectItem Object | VCProjectReference Object | VCReference Object | VCReferences Collection

© 2015 Microsoft