Programming with Reflection

image\rwnprg32.gif GetSaveAsFilename method


Syntax Filename = object.GetSaveAsFilename([InitialFilename], [FileFilter], [FilterIndex], [Title], [ButtonText])



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


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

FileFilter Argument Type: String
Specifies one or more file filtering criteria. These are used to fill a Files of type 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 "Setting Files (*.r4w)", and an MS-DOS wildcard file filter specification corresponding to that type of file, such as "*.txt" or "*.r4w." 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, the default value is "All Files (*.*),*.*".

FilterIndex Argument Type: Integer
Identifies the default FileFilter¾that is, what type of file is listed in the Files of type box when the dialog box is first opened. Use 1 to specify the first FileFilter, 2 to specify the second FileFilter, and so on.

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

ButtonText Argument Type: String
Specifies the text for the default button in the dialog box. If this argument is omitted, the text is either "Save" or "OK" depending on your operating system.


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


image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command