Programming with Reflection

image\rwnprg32.gif GetSaveAsFileName method

 

Syntax FileName = object.GetSaveAsFileName(InitialFilename, FileFileter, FilterIndex, Title, ButtonText)

 

Description

Opens the standard Save As dialog box and gets a file name from the user without actually saving any files.

Arguments

InitialFilename Argument type: String
Optional
Specifies a suggested file name. If this argument is omitted, no default file name is suggested.

FileFilter Argument type: String
Optional
Specifies one or more file filtering criteria. These are used to fill a List files of type list box in the dialog box, and allow the user to select from different types of files to save.

 A file filtering criterion has two parts, separated by a comma: A description, such as "Text Files (.txt)" or "Settings Files (*.rsf)", and an MS-DOS wildcard file filter specification corresponding to that type of file, such as "*.txt" or "*.rsf". You can specify a single file filtering criterion:

 "Text Files (*.txt),*.txt"

 Or multiple file filtering criteria, separated by commas:

 "Text Files (*.txt),*.txt, Bitmaps (*.bmp),*.bmp"

 If this argument is omitted, *.rbs and *.txt files are listed.

FilterIndex Argument type: Integer
Optional
Identifies the default FileFilter—that is, what type of file is listed in the file type list box when the dialog box first opens. Use 1 to specify the first FileFilter, 2 to specify the second FileFilter, and so on.

Title Argument type: String
Optional
Specifies a title for the dialog box. If this argument is omitted, the title is "Save As".

ButtonText Argument type: String
Optional
Specifies the text for the default button in the dialog box. If this argument is omitted, the text is "Save."

Return

FileName Return type: String
The file name (including drive and path information) the user selects, or an empty string if the user selects Cancel.

 

image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command