if SaveDialog1.Execute then begin if FileExists(SaveDialog1.FileName) then if Application.MessageBox('文件已经存在,确定要覆盖吗?', '提示', MB_YESNO or MB_ICONWARNING) = IDNO then Exit; if SaveDialog1.FilterIndex = 1 then SaveDBGridEhToExportFile(TDBGridEhExportAsXLS, DBGrid_main, SaveDialog1.FileName, true); if SaveDialog1.FilterIndex = 2 then SaveDBGridEhToExportFile(TDBGridEhExportAsHTML, DBGrid_main, SaveDialog1.FileName, true); if SaveDialog1.FilterIndex = 3 then SaveDBGridEhToExportFile(TDBGridEhExportAsText, DBGrid_main, SaveDialog1.FileName, true); end;