IVsSolution::SaveSolutionElement Method (UInt32, IVsHierarchy^, UInt32)

 

Programmatically saves a document, a project, or the entire solution.

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

int SaveSolutionElement(
	unsigned int grfSaveOpts,
	IVsHierarchy^ pHier,
	unsigned int docCookie
)

Parameters

grfSaveOpts
Type: System::UInt32

[in] Save Options. For a list of grfSaveOpts, see __VSSLNSAVEOPTIONS.

pHier
Type: Microsoft.VisualStudio.Shell.Interop::IVsHierarchy^

[in] Pointer to the IVsHierarchy interface of the document to save.

docCookie
Type: System::UInt32

[in] Abstract handle to the element that was saved.

Return Value

Type: System::Int32

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

From vsshell.idl:

HRESULT IVsSolution::SaveSolutionElement(
   [in] VSSLNSAVEOPTIONS grfSaveOpts,
   [in] IVsHierarchy *pHier,
   [in] VSCOOKIE docCookie
);

To save the entire solution, call SaveSolutionElement(grfSaveOpts, null, null). To save a single project, call SaveSolutionElement(grfSaveOpts, phier, null). To save a single document, call SaveSolutionElement(grfSaveOpts, null, docCookie).

Return to top
Show: