Need to Delete some files

froggiebeckie

Registered User.
Local time
Today, 10:44
Joined
Oct 11, 2002
Messages
104
Before I spend a load of time on this, thought I'd check to see if it's even possible.

Thanks to some help from folks here, I have some code that allows me to output some reports to a folder and then email those reports as attachments, all from inside my db.

Now I'd also like to delete those files after the email is sent, before the module ends.

Anyone know if this is doable? If so, I'll get started working on the code.

Thanks
BeckieO
 
From VBA, use the Kill verb on a string variable that contains the device, path, name, and type of the file to be whacked. Look it up in Access Help before using it so you can find any nuances that I'm glossing over.
 
Good Deal!!

Just the kind of info I was hoping for.

Thanks so much.
BeckieO
 
Code That Works for Me

Based on advise from The_Doc_Man, after a little research, I inserted this code into my module:


' Remove Files from Drive
Kill ("C:\My Documents\SendFiles\*.snp")

It removes all Snapshot files from the folder, as soon as the email is sent.


Thought maybe someone else might find this useful.

BeckieO
 
Just an FYI you can also use the File System Ojbect to delete files and other file maintience activities.
 

Users who are viewing this thread

Back
Top Bottom