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

Extension Property

Visual Studio .NET 2003

Returns the extension of a file.

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


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

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

Public Module Module1
    Sub Test()
        Dim idx As Integer
        Dim prj As VCProject
        Dim file As VCFile
        Dim col As IVCCollection
        prj = DTE.Solution.Projects.Item(1).Object
        col = prj.Files
        For idx = 1 To col.Count
            file = col.Item(idx)
    End Sub
End Module

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

See Also

Applies To: VCFile Object

© 2015 Microsoft