This documentation is archived and is not being maintained.

Open Method (General Extensibility)

Visual Studio .NET 2003

Opens the solution or project item in the specified view.

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

Parameters

Filename or ViewKind
Required. For the Solution object, the filename of the file to open. For the ProjectItem object, a vsViewKind constant indicating the type of view to use.

Return Value

Returns a Window object.

Example

Sub OpenExample()
   ' This function loads an existing solution.
   Dim soln As Solution
   'Create a reference to the solution.
   soln = DTE.Solution
   ' Open the solution. NOTE: Change path below to an actual solution.
   soln.Open("c:\temp2\newsolution.sln")
End Sub

See Also

AddFromFile Method (ProjectItems Collection) | AddFromFile Method (Solution Object) | AddFromTemplate Method (ProjectItems Object) | AddFromTemplate Method (Solution Object) | IsOpen Property (General Extensibility) | IsOpen Property (ProjectItem Object)

Applies To: ProjectItem Object | Solution Object

Show: