ItemOperations::OpenFile Method (String^, String^)

 

Opens a file as though you invoked an Open File command in the integrated development environment (IDE).

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Window^ OpenFile(
	String^ FileName,
	String^ ViewKind = "{00000000-0000-0000-0000-000000000000}"
)

Parameters

FileName
Type: System::String^

Required. The full path and name of the file to be opened.

ViewKind
Type: System::String^

Optional. A Constants vsViewKind* constant specifying the type of view in which to create the file.

Return Value

Type: EnvDTE::Window^

A Window object.

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
Return to top
Show: