If not opendialog1.execute then exit; //нажали отмену или крест edit1.text:=opendialog1.filename; //имя файла который выбрал пользователь