This documentation is archived and is not being maintained.

IVsUIShellOpenDocument.OpenSpecificEditor Method

Opens a specified editor.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in

int OpenSpecificEditor (
	[InAttribute] uint grfOpenSpecific,
	[InAttribute] string pszMkDocument,
	[InAttribute] ref Guid rguidEditorType,
	[InAttribute] string pszPhysicalView,
	[InAttribute] ref Guid rguidLogicalView,
	[InAttribute] string pszOwnerCaption,
	[InAttribute] IVsUIHierarchy pHier,
	[InAttribute] uint itemid,
	[InAttribute] IntPtr punkDocDataExisting,
	[InAttribute] IServiceProvider pSPHierContext,
	out IVsWindowFrame ppWindowFrame
int OpenSpecificEditor (
	/** @attribute InAttribute() */ UInt32 grfOpenSpecific, 
	/** @attribute InAttribute() */ String pszMkDocument, 
	/** @attribute InAttribute() */ /** @ref */ Guid rguidEditorType, 
	/** @attribute InAttribute() */ String pszPhysicalView, 
	/** @attribute InAttribute() */ /** @ref */ Guid rguidLogicalView, 
	/** @attribute InAttribute() */ String pszOwnerCaption, 
	/** @attribute InAttribute() */ IVsUIHierarchy pHier, 
	/** @attribute InAttribute() */ UInt32 itemid, 
	/** @attribute InAttribute() */ IntPtr punkDocDataExisting, 
	/** @attribute InAttribute() */ IServiceProvider pSPHierContext, 
	/** @attribute OutAttribute() */ /** @ref */ IVsWindowFrame ppWindowFrame
JScript does not support passing value-type arguments by reference.



[in] Values taken from the __VSOSPEFLAGS enumeration.


[in] String form of the unique moniker identifier of the document in the project system. If the document is a file, you can simply specify the file extension for this parameter rather than the full path to the file (for example, .bmp or txt). In non-file cases, this identifier is often in the form of a URL.


[in] Unique identifier of the editor type.


[in] Name of the physical view. If a null reference (Nothing in Visual Basic), the environment calls MapLogicalView on the editor factory to determine the physical view that corresponds to the logical view. In this case, a null reference (Nothing in Visual Basic) does not specify the primary view, but rather indicates that you do not know which view corresponds to the logical view.


[in] GUID identifying the logical view. For a list of logical view GUIDS, see Interaction Between Logical Views and Physical Views. If you implement IVsMultiViewDocumentView on your document view object, then the value passed into the rguidLogicalView parameter determines which view is activated when the editor window is shown when the editor is instantiated. By specifying the logical view GUID, the caller of InitializeEditorInstance can request the specific view that matches the reason the caller is requesting the view. For example, the caller would specify LOGVIEWID_Debugging to get the view appropriate for debugging view, or LOGVIEWID_TextView to get the view appropriate for the text editor (that is, a view that implements IVsCodeWindow).


[in] Initial caption defined by the document owner (that is, the project) for the document window. This is often of the form: "ProjectName – ItemName."


[in] Pointer to the IVsUIHierarchy interface.


[in] UI hierarchy item identifier for the specified editor. For more information see VSITEMID.


[in] Pointer to the IUnknown interface.


[in] Pointer to the IServiceProvide interface.


[out, retval] Pointer to the IVsWindowFrame interface.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From vsshell.idl:

HRESULT IVsUIShellOpenDocument::OpenSpecificEditor(
   [in] VSOSPEFLAGS grfOpenSpecific,
   [in] LPCOLESTR pszMkDocument,
   [in] REFGUID rguidEditorType,
   [in] LPCOLESTR pszPhysicalView,
   [in] REFGUID rguidLogicalView,
   [in] LPCOLESTR pszOwnerCaption,
   [in] IVsUIHierarchy *pHier,
   [in] VSITEMID itemid,
   [in] IUnknown *punkDocDataExisting,
   [in] IServiceProvider *pSPHierContext,
   [out, retval] IVsWindowFrame **ppWindowFrame