0 out of 2 rated this helpful - Rate this topic

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)

Window OpenFile (
	[InAttribute] string FileName,
	[OptionalAttribute] [InAttribute] string ViewKind
)
Window OpenFile (
	/** @attribute InAttribute() */ String FileName, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ String ViewKind
)
function OpenFile (
	FileName : String, 
	ViewKind : String
) : Window

Parameters

FileName

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

ViewKind

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

Return Value

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
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Advertisement