uses Registry
tey
if not Assigned(WordObject) then
begin
WordObject:= TWordObject.Create;
with WordObject do
begin
if MasterDataSet.FieldByName('NAME').AsString='' then
Caption:= '材料准入手续'
else
Caption:= MasterDataSet.FieldByName('NAME').AsString;
WordObject.Application.Get_Options.AllowFastSave:= False;
Visible:= True;
OnQuit:= AppQuit;
OnCloseDocument:= DocClose;
end;
end;
except
showmessage('没有装Word');
end;
procedure TF_PU_SUPP_AGRE40.AppQuit(Sender: TObject);
begin
with MasterDataSet do
begin
Edit;
(FieldByName('REMA') as TBlobField).LoadFromFile('C:/Agree.Doc');
end;
WordObject.Free;
WordObject:= nil;
end;
procedure TF_PU_SUPP_AGRE40.DocClose(Sender: TObject);
begin
WordObject.SaveAs('C:/Agree.Doc');
end;