This documentation is archived and is not being maintained.

FileCount Property (General Extensibility)

Visual Studio .NET 2003

Returns the number of files associated with a project item or output group.

[Visual Basic .NET]
Public ReadOnly Property FileCount() As Long
[Visual Basic 6]
Property Get FileCount() As Long
HRESULT __stdcall get_FileCount(
   /* [out, retval] */ long* retVal
int FileCount {get;}
[JScript .NET]
public function get FileCount() : int


For the ProjectItem object, most project items consist of only one file, but some can have more than one, as with forms in Visual Basic which are saved as both .frm (text) and .frx (binary) files.

For the OutputGroup object, the item should first be built to accurately determine the output files.


Sub FileCountExample()
   ' Must have a project open before running this.
   Dim ProjItem As ProjectItem
   ProjItem = DTE.Solution.Projects.Item(1).ProjectItems.Item(1)
   MsgBox("Number of files: " & ProjItem.FileCount)
End Sub

See Also

FileNames Property (OutputGroup Object) | OutputGroups Property

Applies To: ProjectItem Object | OutputGroup Object