Question re FileSystemObject

G

Gina

Hi all.

I am trying to do a cleanup when closing my access mdb.

Data has been transferred to word.
All works fine but when for a reason no data has been transferred to word
and so no *.dot is in the temp folder an error occurs with message 'file not
found'
what changes need to be made in order to: "only kill files *.dot when
something is in temp folder otherwise no cleanup necessary"

here's my code:
***
....
sysTemp = Environ("TEMP")

Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.GetFolder(sysTemp)

If Folder <> "" Then
Kill sysTemp & "\*.dot"
End If
....
***

Many thanks in advance !!

Gina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top