cs_othland
Messages postés298Date d'inscriptionjeudi 18 décembre 2003StatutMembreDernière intervention 9 février 2010
-
17 oct. 2006 à 14:50
yvessimon
Messages postés637Date d'inscriptionmardi 22 avril 2003StatutMembreDernière intervention 9 janvier 2017
-
19 oct. 2006 à 08:59
slt tlm;
j'ai une application delphi qui sauvegarde une table dans un fichier EXCEL, j'ai utilisé la méthode suivante:
OleWorkBook.SaveAs['C:\dell\exc001'];
mon problème c'est lors d'une 2emme execution de mon application, WINDOWS me demande est ce que je veux ecraser mon fichier exsitant ou pas, moi, je ne veux pas que cette fenêtre s'affiche et je veux aussi que WINDOWS l'écrase directement, avez vous une solution???
merci
ZEGHBAABBES
Messages postés4Date d'inscriptiondimanche 1 octobre 2006StatutMembreDernière intervention17 mars 2008 17 oct. 2006 à 15:21
Salut
Pour résoudre votre problème il faut utiliser la commande
/////// if FileExists(SaveDialog1.FileName) then
pour tester si le fichier existe ou pas dans le répertoire C:\dell\
/////////
et voir la fonction copyfile
BOOL CopyFile(
LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
Parameters
lpExistingFileName
Points to a null-terminated string that specifies the name of an existing file.
lpNewFileName
Points to a null-terminated string that specifies the name of the new file.
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.