var sPath : string; begin ... if not FileExists( sPath ) then begin MessageDlg( Format( 'File "%s" not found.', [sPath] ), mtError, [mbOk], 0 ); exit; end; ... end;