1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
w1.Connect;
ol:='v:\ppr\relance_cram.doc';
wd1:=w1.Documents.Open(ol,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam);
with wd1.mailmerge do
begin
Destination:=wdsendtonewdocument;
suppressblanklines:=true;
datasource.FirstRecord:=wddefaultfirstrecord;
datasource.LastRecord:=wddefaultlastrecord;
pause:=false;
execute(pause);
end;
try
deletefile(fichier);
except
end;
newword:=w1.ActiveDocument;
newword.SaveAs(fichier,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,
emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam
,emptyparam,emptyparam,emptyparam);
w1.activedocument.saved:=true;
wd1.Close(emptyparam,emptyparam,emptyparam);
w1.quit;
w1.Disconnect; |
Partager