We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

IVsRunningDocumentTable.SaveDocuments Method

Saves the documents.

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

int SaveDocuments(
	uint grfSaveOpts,
	IVsHierarchy pHier,
	uint itemid,
	uint docCookie


Type: System.UInt32

[in] Save options whose values are taken from the __VSRDTSAVEOPTIONS enumeration.

Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy

[in] The IVsHierarchy interface that owns the document.

Type: System.UInt32

[in] Item identifier of the saved documents. This is a unique identifier or it can be one of the following values: VSITEMID_NIL, VSITEMID_ROOT, or VSITEMID_SELECTION.

Type: System.UInt32

[in] Abstract value representing the saved documents.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From vsshell.idl:

HRESULT IVsRunningDocumentTable::SaveDocuments(
   [in] VSRDTSAVEOPTIONS  grfSaveOpts,
   [in] IVsHierarchy     *pHier,
   [in] VSITEMID          itemid,
   [in] VSCOOKIE          docCookie

The docCookie parameter is same value that is returned from the FindAndLockDocument or RegisterAndLockDocument methods.