var
defaultPath:string; //这里可以设置为全局变量
begin if SaveDialog1.Execute then begin defaultPath := SaveDialog1.FileName; //文件路径+文件名,不确定是否包含后缀 if ExtractFileExt(defaultPath) = '' then //判断用户是否有输入后缀名 begin case SaveDialog1.FilterIndex of //请根据过虑器来设置条件 1: defaultPath := defaultPath + '.xlsx'; 2: defaultPath := defaultPath + '.xls'; end; end; dxSpreadSheet1.savetofile(defaultPath); //保存文件D end;
标签:SaveDialog,因无,end,defaultPath,begin,后缀名,文件,SaveDialog1 From: https://www.cnblogs.com/yoooos/p/16668733.html