Export (0) Print
Expand All

_Solution.FindProjectItem Method

Locates an item in a project.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

ProjectItem FindProjectItem (
	string FileName
ProjectItem FindProjectItem (
	String FileName
function FindProjectItem (
	FileName : String
) : ProjectItem



Required. The name of the project item.

Return Value

A ProjectItem object.

FindProjectItem performs an ItemOperations.OpenFile type search for the given file name. The first project found to have the item returns its ProjectItem object for the name. If the file is not found in the solution, a null reference (Nothing in Visual Basic) is returned.

Sub CreateExample()
   ' Open a solution before running this example.
   Dim soln As Solution

   ' Create a reference to the solution.
   soln = DTE.Solution

   ' Find the specified project.
End Sub

Community Additions

© 2014 Microsoft