OpenFile
Cut
Run
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

OpenFile Method

Visual Studio .NET 2003

Opens a file as though you invoked an Open File command in the IDE.

[Visual Basic .NET]
Public Function OpenFile( _
   ByVal FileName As String, _
   Optional ByVal ViewKind As String = "{00000000-0000-0000-0000-000000000000}" _
) As Window
[Visual Basic 6]
Function OpenFile( _
   ByVal FileName As String, _
   Optional ByVal ViewKind As String = "{00000000-0000-0000-0000-000000000000}" _
) As Window
[C++]
HRESULT __stdcall OpenFile(
   BSTR FileName,
   BSTR ViewKind,
   /* [out, retval] */ Window** retVal
);
[C#]
public Window OpenFile(
   string FileName,
   string ViewKind
);
[JScript .NET]
public function OpenFile(
   FileName : String,
   ViewKind : String
) : Window

Parameters

FileName
Required. The full path and name of the file to be opened.
ViewKind
Optional. A vsViewKind constant specifying the type of view in which to open the file.

Return Value

Returns a Window object.

Example

Sub OpenFileExample()
   Dim ItemOp As ItemOperations
   ItemOp = DTE.ItemOperations
   ' Open a log file as a text document.
   ItemOp.OpenFile("c:\windows\ocgen.log", Constants.vsViewKindTextView)
End Sub

See Also

Applies To: ItemOperations Object

Show:
© 2016 Microsoft