ShowSaveAs Method (ACommonDialog)

Displays the SaveAs dialog box.

Syntax

[ enRetVal = ] Object.ShowSaveAs()

The ShowSaveAs method syntax has the following parts:

 

Name

Type

Description

Object

An Object

An object

enRetVal

Val enumACommonDialogRetVal

An integer specifying the status of the dialog box.

Where

enumACommonDialogRetVal can be one of the following:

 

Name

Value

Description

acdlgRetValOk

0x00000000

OK

acdlgRetValCancel

0x00000001

Cancel

acdlgRetValError

0x00000002

Error

Comments

After initializing the dialog box’s properties, call the ShowSaveAs method to display the dialog box and allow the user to enter the path and file.

Example

The following example will display the save the work if the user pressed the OK button:

cdlg.InitDir="c:\\MyDir"

cdlg.FileName="c:\\MyProgram.PRG"

cdlg.Filter=Program Files (*.PRG)|*.PRG

cdlg.DefaultExt="PRG"

cdlg.SaveAsOptions=acdlgSaveAsOptionsExlorer OR acdlgSaveAsOptionsNoChangeDir

if (cdlg.ShowSaveAs() = acdlgRetValOk)

if ( FileHandle=FileOpen(cdlg.FileName))

FileWrite(FileHandle, ....)

Applies to

ACommonDialog

See Also

OpenOptions, SaveAsOptions, ShowOpen