oCD = Newobject("_comdlg", "_system") oCD.AddFilter("Excel files (*.xls)", "*.xls") * Dialog properties. oCD.cTitlebarText = "Specify file name for excle table" * Initial defaults. oCD.cFileName = "test.xls" oCD.cInitialDirectory = "h:\temp" oCD.cDefaultExtension = "XLS" oCD.lSaveDialog = .t. * Display the dialog and get results. ? oCD.showdialog() ? "Files were chosen from:", oCD.cFilePath ? "FileName property:", oCD.cFileName ? "FileTitle property:", oCD.cFileTitle ? "FileCount property:", oCD.nFileCount ? "Custom filter that the user created:" , oCD.cCustomFilter ? "Filter index (which of our filters the user selected):", oCD.nFilterIndex oCD.clearfilters()Be advises that there's a bug in the class. Here's a fix
IF THIS.lAllowMultiSelect AND nFileNameOffset > 1 AND SUBSTR(lcFileName, nFileNameOffset, 1) = CHR(0) ... <b>THIS.cFileName = LEFT(lcFileName, AT(CHR(0), lcFileName) - 1)</b> ELSE ... <b>THIS.cFileName = lcFileName</b> ENDIF <b>*THIS.cFileName = LEFT(lcFileName, AT(CHR(0), lcFileName) - 1)</b>>When using PUTFILE(), I know it's possible to submit a list of extensions as a parameter, which show up as the file types.