108
if OpenDialog1.filename='' then
OpenDialog1.filename:=ExtractFilePath(ParamStr(0))+'shablon\'+Edt2.Text;
With AdoQuery1 do
begin
close;
SQl.clear;
SQL.add('UPDATE shablon SET caption = :caption, path = :path WHERE id =
:id');
Parameters.ParamByName('caption').value:=Edt1.text;
Parameters.ParamByName('path').value:=ExtractFileName(OpenDialog1.Filename);
Parameters.ParamByName('id').value:=label3.caption;
execSQL;
end;
produre TFrm2.BitBtn4Click(Send: TObject);
var
Word:Variant;
begin
if fileExists(Edt2.text) then
begin
Word := CreateOleObject('Word.Application');
Word.Documents.Add(Edt2.text);
if not (copy(caption,length(caption)-1,1) = '*') then caption:=caption+'*';
Word.visible:=true;
end
else
begin
Showmessage(' Файл '+Edt2.text+' не найден.'+#10+#13+'Проверьте
правильность названия файла и его наличие в указанной папке.');
end;