ItemOperations.OpenFile Method
Opens a file as though you invoked an Open File command in the integrated development environment (IDE).
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Function OpenFile ( _
FileName As String, _
ViewKind As String _
) As Window
Window OpenFile(
string FileName,
string ViewKind
)
Window^ OpenFile(
[InAttribute] String^ FileName,
[InAttribute] String^ ViewKind
)
abstract OpenFile :
FileName:string *
ViewKind:string -> Window
function OpenFile(
FileName : String,
ViewKind : String
) : Window
Parameters
FileName
Type: System.StringRequired. The full path and name of the file to be opened.
ViewKind
Type: System.StringOptional. A ConstantsvsViewKind* constant specifying the type of view in which to create the file.
Return Value
Type: EnvDTE.Window
A Window object.
Examples
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
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.