Inheritance diagram for FileOpenSaveDialog:


| Public Member Functions | |
| Execute ([out, retval] VARIANT_BOOL *pResult) | |
| Shows the dialog. | |
| AddPlace ([in] BSTR Value,[in, defaultvalue("")] BSTR Name,[in, defaultvalue(0)] LONG Placement) | |
| Adds a folder to the list of places. | |
| Properties | |
| BSTR RW | DefaultExt  [] | 
| Gets or sets the default extension. | |
| BSTR RW | Filter  [] | 
| Gets or sets the filter. | |
| BSTR RW | FileName  [] | 
| Gets or sets the selected file name. | |
| ULONG RW | Flags  [] | 
| See the "Flags" argument of the OpenDialog method. | |
| BSTR RW | Text  [] | 
| Gets or sets the title of the dialog. | |
| ULONG RW | FilterIndex  [] | 
| Gets or sets the selected index of the filter selection combobox. | |
| BSTR RW | Directory  [] | 
| Gets or sets the current directory for the dialog. | |
| VARIANT_BOOL RW | OverwritePrompt  [] | 
| Causes the Save As dialog box to generate a message box if the selected file already exists. | |
| VARIANT_BOOL RW | AllowMultiselect  [] | 
| Specifies that the Dialog allows multiple selections. | |
| VARIANT_BOOL RW | PathMustExist  [] | 
| Specifies that the user can type only valid paths and file names. | |
| VARIANT_BOOL RW | FileMustExist  [] | 
| Specifies that the user can type only names of existing files. | |
| VARIANT_BOOL RW | CreatePrompt  [] | 
| Prompt for creation if the item returned in the save dialog does not exist. | |
| VARIANT_BOOL RW | NoReadOnlyReturn  [] | 
| Do not return read-only items. | |
| VARIANT_BOOL RW | NoTestFileCreate  [] | 
| Do not test creation of the item returned in the save dialog. | |
| VARIANT_BOOL RW | NoDereferenceLinks  [] | 
| Shortcuts should not be treated as their target items, allowing an application to open a .lnk file. | |
| VARIANT_BOOL RW | DontAddToRecent  [] | 
| Do not save the item being opened or saved to the list of recent places. | |
| VARIANT_BOOL RW | ForceShowHidden  [] | 
| Always show hidden items. | |
| VARIANT_BOOL RW | NoPlacesBar  [] | 
| If "TRUE", the places bar is not displayed. | |
| VARIANT_BOOL RW | ForceFileSystem  [] | 
| Ensures that returned items are file system items (SFGAO_FILESYSTEM). | |
| VARIANT_BOOL RW | AllNonStorageItems  [] | 
| Enables the user to choose any item in the shell namespace, not just those with SFGAO_STREAM or SFAGO_FILESYSTEM attributes. | |
| VARIANT_BOOL RW | HideMRUPlaces  [] | 
| Hide the list of places from which the user has recently opened or saved items. | |
| VARIANT_BOOL RW | HidePinnedPlaces  [] | 
| Hide the list of pinned places from which the user can choose. | |
| VARIANT_BOOL RW | DefaultNoMiniMode  [] | 
| Indicates to the Save As dialog box that it should open in expanded mode. | |
| VARIANT_BOOL RW | ForcePreviewPaneOn  [] | 
| Indicates to the Open dialog box that the preview pane should always be displayed. | |
| IDispatch *R | FileNames  [] | 
| Return a Collection that contains list of the selected file names. | |
| BSTR RW | ClientGuid  [] | 
| Associates a GUID with a dialog's persisted state. | |
| VARIANT W | OnCloseQuery  [] | 
| Sets the event handler for the OnCloseQuery event. | |
| VARIANT W | OnChange  [] | 
| Sets the event handler for the OnChange event. | |
| VARIANT W | OnFolderChange  [] | 
| Sets the event handler for the OnFolderChange event. | |
| VARIANT W | OnTypeChange  [] | 
| Sets the event handler for the OnTypeChange event. | |
| VARIANT W | OnHelp  [] | 
| Sets the event handler for the OnHelp event. | |
o = new ActiveXObject("Scripting.WindowSystemObject") f = o.CreateForm(0,0,0,0) f.ClientWidth = 500 f.ClientHeight = 300 f.CenterControl() f.Text = "Text Editor" edit = f.CreateEdit(0,0,0,0) edit.Align = o.Translate("AL_CLIENT") edit.HideSelection = false edit.MultiLine = true edit.ScrollBars = o.Translate("SS_BOTH") fileMenu = f.Menu.Add("File") fileMenu.Add("Open","CTRL+O").OnExecute = FileOpen fileMenu.NewLine() fileMenu.Add("Exit","ESC").OnExecute = CloseFormHandler function FileOpen(sender) { var Dialog = f.CreateOpenDialog() Dialog.Filter = "Text Files (*.txt)|*.txt" Dialog.Text = "Select a text file" if (Dialog.Execute()) { var fileName = Dialog.FileName var fs = new ActiveXObject("Scripting.FileSystemObject") var file = fs.OpenTextFile(fileName,1,false) edit.Clear() edit.Text = file.ReadAll() } } f.Show() o.Run() function CloseFormHandler(sender) { sender.Form.Close() }
Windows Vista file dialog:
 
Windows 2000/XP file dialog:
 
| AddPlace | ( | [in] BSTR | Value, | |
| [in, defaultvalue("")] BSTR | Name, | |||
| [in, defaultvalue(0)] LONG | Placement | |||
| ) | 
Adds a folder to the list of places.
| Value | The folder. | |
| Name | Name. | |
| Placement | The placement, can be a one of the following values: 
 | 
| Execute | ( | [out, retval] VARIANT_BOOL * | pResult | ) | 
Shows the dialog.
| VARIANT_BOOL RW AllNonStorageItems | 
Enables the user to choose any item in the shell namespace, not just those with SFGAO_STREAM or SFAGO_FILESYSTEM attributes.
This flag cannot be combined with FOS_FORCEFILESYSTEM.
Only for new Vista file dialogs.
| VARIANT_BOOL RW AllowMultiselect | 
Specifies that the Dialog allows multiple selections.
IFileDialog, FOS_ALLOWMULTISELECT in the MSDN.
| BSTR RW ClientGuid | 
Associates a GUID with a dialog's persisted state.
Only for new Vista file dialogs.
The dialog's state can include information about the last visited folder, the position and size of the dialog.
Example:
o = new ActiveXObject("Scripting.WindowSystemObject") f = o.CreateForm(0,0,0,0) f.ClientWidth = 500 f.ClientHeight = 300 f.CenterControl() f.CreateButton(10,10,75,25,"Open 1").OnClick = function() { var Dialog = f.CreateOpenDialog() Dialog.Filter = "All files (*.*)|*.*" Dialog.ClientGuid = "10000000-0000-0000-0000-000000000000" if (Dialog.Execute()) { f.MessageBox(Dialog.FileName) } } f.CreateButton(100,10,75,25,"Open 2").OnClick = function() { var Dialog = f.CreateOpenDialog() Dialog.Filter = "All files (*.*)|*.*" Dialog.ClientGuid = "20000000-0000-0000-0000-000000000000" if (Dialog.Execute()) { f.MessageBox(Dialog.FileName) } } f.Show() o.Run()
| VARIANT_BOOL RW CreatePrompt | 
Prompt for creation if the item returned in the save dialog does not exist.
IFileDialog, FOS_CREATEPROMPT in the MSDN.
| BSTR RW DefaultExt | 
Gets or sets the default extension.
| VARIANT_BOOL RW DefaultNoMiniMode | 
Indicates to the Save As dialog box that it should open in expanded mode.
| BSTR RW Directory | 
Gets or sets the current directory for the dialog.
Returns empty string for a virtual folder.
| VARIANT_BOOL RW DontAddToRecent | 
Do not save the item being opened or saved to the list of recent places.
IFileDialog, FOS_DONTADDTORECENT in the MSDN.
| VARIANT_BOOL RW FileMustExist | 
Specifies that the user can type only names of existing files.
IFileDialog, FOS_PATHMUSTEXIST in the MSDN.
| BSTR RW FileName | 
Gets or sets the selected file name.
| IDispatch* R FileNames | 
Return a Collection that contains list of the selected file names.
Can be used only in the OnCloseQuery event handler or after Execute method.
Example:
o = new ActiveXObject("Scripting.WindowSystemObject") f = o.CreateForm(0,0,0,0) f.ClientWidth = 500 f.ClientHeight = 300 f.CenterControl() f.CreateButton(10,10,75,25,"Open").OnClick = function() { var Dialog = f.CreateOpenDialog() Dialog.AllowMultiSelect = true Dialog.Filter = "All files (*.*)|*.*" if (Dialog.Execute()) { var FileNames = Dialog.FileNames var Str = "" for (var i = 0; i<FileNames.Count; i++) { Str += FileNames.item(i) Str += "\r\n" } f.MessageBox(Str) } } f.Show() o.Run()
| BSTR RW Filter | 
Gets or sets the filter.
See the "Filter" argument of the OpenDialog method.
| ULONG RW FilterIndex | 
Gets or sets the selected index of the filter selection combobox.
Minimum value 1.
| ULONG RW Flags | 
See the "Flags" argument of the OpenDialog method.
| VARIANT_BOOL RW ForceFileSystem | 
Ensures that returned items are file system items (SFGAO_FILESYSTEM).
Only for new Vista file dialogs.
| VARIANT_BOOL RW ForcePreviewPaneOn | 
Indicates to the Open dialog box that the preview pane should always be displayed.
| VARIANT_BOOL RW ForceShowHidden | 
Always show hidden items.
IFileDialog, FOS_FORCESHOWHIDDEN in the MSDN.
| VARIANT_BOOL RW HideMRUPlaces | 
Hide the list of places from which the user has recently opened or saved items.
| VARIANT_BOOL RW HidePinnedPlaces | 
Hide the list of pinned places from which the user can choose.
| VARIANT_BOOL RW NoDereferenceLinks | 
Shortcuts should not be treated as their target items, allowing an application to open a .lnk file.
IFileDialog, FOS_NODEREFERENCELINKS in the MSDN.
| VARIANT_BOOL RW NoPlacesBar | 
If "TRUE", the places bar is not displayed.
Only for pre Vista file dialogs.
Default value: FALSE.
| VARIANT_BOOL RW NoReadOnlyReturn | 
Do not return read-only items.
IFileDialog, FOS_NOREADONLYRETURN in the MSDN.
| VARIANT_BOOL RW NoTestFileCreate | 
Do not test creation of the item returned in the save dialog.
IFileDialog, FOS_NOTESTFILECREATE in the MSDN.
| VARIANT W OnChange | 
Sets the event handler for the OnChange event.
This event occurs when the user changes the selection.
| VARIANT W OnCloseQuery | 
Sets the event handler for the OnCloseQuery event.
This event occurs when the user tries to close the dialog.
| VARIANT W OnFolderChange | 
Sets the event handler for the OnFolderChange event.
This event occurs when the user changes the current folder.
| VARIANT W OnHelp | 
Sets the event handler for the OnHelp event.
This event occurs when the user clicks the "Help" button.
| VARIANT W OnTypeChange | 
Sets the event handler for the OnTypeChange event.
This event occurs when the user changes the selected value of the filter combobox.
| VARIANT_BOOL RW OverwritePrompt | 
Causes the Save As dialog box to generate a message box if the selected file already exists.
The user must confirm to overwrite the file
IFileDialog, FOS_OVERWRITEPROMPT in the MSDN.
| VARIANT_BOOL RW PathMustExist | 
Specifies that the user can type only valid paths and file names.
IFileDialog, FOS_PATHMUSTEXIST in the MSDN.
| BSTR RW Text | 
Gets or sets the title of the dialog.