Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to remove files from project.
Message
 
 
À
15/08/2001 12:53:34
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00544182
Message ID:
00544190
Vues:
21
Greg,
The files collection has Add() method but not Remove(). The File object has Remove() method. You have to get reference to the file object that represent the file you want to delete. Something like
For Each loFile in VFP.ActiveProject.Files
  IF Upper(loFile.Name) = UPPER("c:\vfp\bmps\abc.bmp")
    loFile.Remove()
  ENDIF
Endfor
>Why am I getting a OLE error code when I run this code. The file exists in both
>my project and in the directory. Files.add works.
>
>_VFP.ActiveProject.Files.remove("c:\vfp\bmps\abc.bmp")
>
>Thanks,
>
>-Greg
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform