SaveAs Method (Document object)

Saves the document with the specified parameters: filename, document format version, workspace, etc.

Applies to: Document object

Syntax

[[Let] booleanRet =] object.SaveAs ( fileName, saveFlags, saveVersion, showSaveDlg )

The SaveAs method syntax has these parts:

Part Description
object Required. An expression that returns an instance of the Document object.
fileName Required. An expression that returns a String value. The name of the file, to save the document in.
saveFlags Required. An expression that returns a Long value. The flags describing the contents of the saved document.
saveVersion Required. An expression that returns a Long value. The version of the format to save the document in.
showSaveDlg Optional. An expression that returns a Boolean value. A flag that indicates whether to show the file save dialog: True - display the dialog, False - not to display the dialog and use the name, specified by the fileName parameter. The default value is False.
booleanRet Optional. A Boolean type variable.

Remarks

The saveFlags parameter can take the following values:

Constant Value Description
cdSaveWithWS &H1 Save the workspace information together with the document.
cdSaveAsTemplate &H2 Save the document as template

The document format version saveVersion specifies in which format to save the document. The saveVersion parameter can take the following values: 200 or greater - the document is in the ConceptDraw V format, between 0 and 200 - the document is in the ConceptDraw 1.x format. To save the document in the same format it was saved before, set saveVersion to 0 or less.

If the document has been saved successfully with the specified parameters, the SaveAs method returns True. Otherwise, the method returns False.

Saving the document under fileName different from the current document filename changes the corresponding properties of the document: the FullName property, the Name property, the Path property. If the name of the file, specified in fileName equals to an empty string, the method attempts to save the document under the current filename. If the document hasn't been yet saved, the name of the file (the Name property) is made up automatically of the document title (the Title property) and the standard extension for ConceptDraw documents (.cdd) and then the document is saved in the current folder of the application. Also, by using the showSaveDlg parameter it's possible to specify the filename manually.

 

See Also

OpenDoc method, Save method