Document::Save Method (String^)
Visual Studio 2015
Saves the document.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- FileName
-
Type:
System::String^
Optional. The name in which to save the document. Defaults to the path associated with this document. That is, if an empty string is passed, the document is saved with its current name.
Return Value
Type: EnvDTE::vsSaveStatusA vsSaveStatus constant indicating whether or not the save was successful.
If FileName cannot be written, such as when the disk is full or there are write permission problems, then Save produces an error. The file is saved with a new name based on FileName.
The FileName parameter is optional in Visual Studio 2010, but not optional in Visual Studio 2008.
Sub SaveExample() Dim objDoc As Document ' Create a new text file. DTE.ItemOperations.NewFile("General\Text File") ' Create a document reference. objDoc = DTE.Documents.Item(1) ' Save the new text file. objDoc.Save("c:\temp\mynewdoc.txt") End Sub
Show: