Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FindProjectItem Method
Collapse the table of content
Expand the table of content

FindProjectItem Method

Visual Studio .NET 2003

Locates an item in a project.

[Visual Basic .NET]
Public Function FindProjectItem( _
   FileName As String _
) As ProjectItem
[Visual Basic 6]
Function FindProjectItem( _
   FileName As String _
) As ProjectItem
HRESULT __stdcall FindProjectItem(
   BSTR FileName,
   /* [out, retval] */ ProjectItem** retVal
ProjectItem FindProjectItem(
   string FileName
[JScript .NET]
public function FindProjectItem(
   FileName : String
) : ProjectItem


Required. The name of the project item.

Return Value

Returns 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, 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.
End Sub

See Also

Applies To: Solution Object

© 2015 Microsoft