Mit ExtractFileExt('Dateiname'); kannst du dir das Fileformat ermitteln.
Delphi-Quellcode:
sFileName := OpenDialog1.FileName;
If UpperCase(ExtractFileDir(sFileName)) = '.DOC' Then Begin
...
// Fileformat is a Word Document
...
end
else If UpperCase(ExtractFileDir(sFileName)) = '.TXT' Then Begin
...
// Fileformat is a Text File
...
end;
FLOW