There is a folder with excel files, you need to know the full names of all these files.
3 answers
Discover the FindFirst and FindNext functions .
|
procedure ListFileDir(Path: string; FileList: TStrings); var SR: TSearchRec; begin m:=0; if FindFirst(Path + '*.*', faAnyFile, SR) = 0 then begin repeat if (SR.Attr <> faDirectory) then begin ar[m]:=SR.Name; st[m]:=ar[m]; l:=Length(ar[m]); Delete(st[m], l-3, 4); FileList.Add(st[m]); m:=m+1; end; until FindNext(SR) <> 0; FindClose(SR); end; end;
|
http://delphibasics.ru/FindFirst.php
|