I am trying to delete the temporary files that MS Word leaves behind
sometimes when it fails to clean up properly. Files like ~$lename.dot. I
have used the Kill command, but find that this doesn't work for hidden files
like these. If I change their attributes it works perfectly. Is there a
command that can kill hidden files too? If not, how can I get around this
as this problem prevents some mailmerge templates from operating by
automation because the last time they were used, Word did not delete the
hidden file. I am using VBA to do this as I want to run the command off a
button. I am picking up the path from a DLookup as it varies from site to
site.
Function KillTempFiles()
If Dir(DLookup("[Path]", "tblMailmerge", "mID=1") & "~*.dot") > "" Then
Kill (DLookup("[Path]", "tblMailmerge", "mID=1") & "~*.dot")
End If
On Error Resume Next
End Function
dixie