ProjectItem ProjectItem ProjectItem ProjectItem Interface


Represents an item in a project.

public interface class ProjectItem
public interface ProjectItem
type ProjectItem = interface
Public Interface ProjectItem


' Before running, create a new project or open an existing project.  
Sub ListProj()  
   Dim proj As Project = DTE.ActiveSolutionProjects(0)  
   Dim win As Window = _  
   ListProjAux(proj.ProjectItems(), 0)  
End Sub  

Sub ListProjAux(ByVal projitems As ProjectItems, ByVal Level As Integer)  
   Dim projitem As ProjectItem  
   For Each projitem In projitems  
      MsgBox("Project item: " & projitem.Name, Level)  
      ' Recurse if the project item has sub-items...  
      Dim projitems2 As ProjectItems  
      projitems2 = projitem.ProjectItems  
      Dim notsubcoll As Boolean = projitems2 Is Nothing  
      If Not notsubcoll Then  
         ListProjAux(projitems2, Level + 1)  
      End If  
End Sub  


Collection Collection Collection Collection

Gets the ProjectItems collection containing the ProjectItem object supporting this property.

ConfigurationManager ConfigurationManager ConfigurationManager ConfigurationManager

Gets the ConfigurationManager object for this ProjectItem.

ContainingProject ContainingProject ContainingProject ContainingProject

Gets the project hosting the ProjectItem.

Document Document Document Document

Gets the Document associated with the item, if one exists.


Gets the top-level extensibility object.

Extender[String] Extender[String] Extender[String] Extender[String]

Gets the requested Extender if it is available for this object.

ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID

Gets the Extender category ID (CATID) for the object.

ExtenderNames ExtenderNames ExtenderNames ExtenderNames

Gets a list of available Extenders for the object.

FileCodeModel FileCodeModel FileCodeModel FileCodeModel

Gets the FileCodeModel object for the project item.

FileCount FileCount FileCount FileCount

Gets the number of files associated with a ProjectItem.

FileNames[Int16] FileNames[Int16] FileNames[Int16] FileNames[Int16]

Gets the full path and names of the files associated with a project item.

IsDirty IsDirty IsDirty IsDirty

Microsoft Internal Use Only.

IsOpen[String] IsOpen[String] IsOpen[String] IsOpen[String]

Gets a value indicating whether the project item is open in a particular view type.

Kind Kind Kind Kind

Gets a GUID string indicating the kind or type of the object.

Name Name Name Name

Gets or sets the name of the object.

Object Object Object Object

Gets an object that can be accessed by name at run time.

ProjectItems ProjectItems ProjectItems ProjectItems

Gets a ProjectItems for the object.

Properties Properties Properties Properties

Gets a collection of all properties that pertain to the object.

Saved Saved Saved Saved

Gets or sets a value indicating whether or not the object has been modified since last being saved or opened.

SubProject SubProject SubProject SubProject

If the project item is the root of a subproject, then the SubProject property returns the Project object for the subproject.


Delete() Delete() Delete() Delete()

Removes the item from its project and its storage.

ExpandView() ExpandView() ExpandView() ExpandView()

Expands the view of Solution Explorer to show project items.

Open(String) Open(String) Open(String) Open(String)

Opens the ProjectItem in the specified view.

Remove() Remove() Remove() Remove()

Removes the project item from the collection.

Save(String) Save(String) Save(String) Save(String)

Saves the project or project item.

SaveAs(String) SaveAs(String) SaveAs(String) SaveAs(String)

Saves the project item.

Applies to