Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FindProjectItem Method
Cut
Run
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
[C++]
HRESULT __stdcall FindProjectItem(
   BSTR FileName,
   /* [out, retval] */ ProjectItem** retVal
);
[C#]
ProjectItem FindProjectItem(
   string FileName
);
[JScript .NET]
public function FindProjectItem(
   FileName : String
) : ProjectItem

Parameters

FileName
Required. The name of the project item.

Return Value

Returns a ProjectItem object.

Remarks

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.

Example

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

See Also

Applies To: Solution Object

Show:
© 2015 Microsoft