Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to remove files from project.
Message
 
 
To
15/08/2001 12:53:34
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00544182
Message ID:
00544190
Views:
22
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform