This documentation is archived and is not being maintained.

AddExistingItem Method

Visual Studio .NET 2003

Adds an existing item to the current project.

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

Parameters

FileName
Required. The full path and filename of the item to be added.

Return Value

Returns a ProjectItem object.

Example

Sub AddExistingItemExample()
   Dim ItemOp As ItemOperations
   ItemOp = DTE.ItemOperations
   ' Add a log file to the project.
   ItemOp.AddExistingItem("d:\windows\ocgen.log")
End Sub

See Also

Applies To: ItemOperations Object

Show: