_Solution::FindProjectItem Method (String^)
Visual Studio 2015
Locates an item in a project.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- FileName
-
Type:
System::String^
Required. The name of the project item.
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, null 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. soln.FindProjectItem("c:\temp\someproj.vbproj") End Sub
Show: