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 30
| try
DocWord.Connect;
resu:=true;
except
MessageDlg('Word n''est pas installé', mtError, [mbOk], 0);
Abort;
end;
if resu then
begin
Repertoire:= ExtractFilePath(Application.ExeName);
FileName:= repertoire+'Doc/Etat Congé.docx';
Fichier:= Docword.Documents.Open(FileName, EmptyParam, EmptyParam,EmptyParam, EmptyParam, EmptyParam,
EmptyParam,EmptyParam, EmptyParam, EmptyParam, EmptyParam, true);
Tableau:=fichier.Tables.Item(1);
prepa.First;i:=2;
while not prepa.Eof do
Begin
tableau.Cell(i,1).range.text:=prepa.FieldValues['Matricule'];
tableau.Cell(2,2).range.text:=prepa.FieldValues['Nom'];
tableau.Cell(2,3).range.text:=prepa.FieldValues['Prenom'];
tableau.Cell(i,4).range.text:=prepa.FieldValues['Exercice'];
tableau.Cell(i,5).range.text:=prepa.FieldValues['Reliquat'];
tableau.Cell(i,6).range.text:=prepa.FieldValues['Droit_conge'];
tableau.Cell(i,7).range.text:=prepa.FieldValues['Jour_restant'];
tableau.Rows.Add(Tableau.Rows.Item(Tableau.Rows.Count));
prepa.Next
End;
DocWord.Visible:=true;
docword.Disconnect;
end; |
Partager