I know that you all know that we know where those *.tmp files come from - they're left over after Word has crashed, right?

Well I added something to my knowledge today - I had, for once, a non-maximised window as Word/VBA ran through a table of file names. I'd inserted code to save my table every 5 files (I get a file name from the top row, process that file, then cut/paste the row to the foot of the document).

I also happened to be staring at Explorer in the host directory. There I saw a list building up....

<pre>~WRL2569 TMP 43,520 03-07-02 2:49p ~WRL2569.tmp
~WRL3266 TMP 44,544 03-07-02 2:50p ~WRL3266.tmp
(SNIP)
~WRL3152 TMP 44,032 03-07-02 2:50p ~WRL3152.tmp
</pre>


Trouble is, if Word crashes, they are all left there, of course, and they are Hidden files (I cannot see them with DIR, but can see them with DIR /AH)

So, a caveat of some sorts is be-aware if your application performs frequent saves.

I suppose the same applies to those Word users who maintain that Tools, Options, SaveAutoRecover every 1 minutes is a good idea.

Here's the skeleton of the loop:

<pre>Function lngProcessKitFiles(strFilesDocName As String) As Long
While (lngProcessKitFiles > 0) And (Selection.Information(wdWithInTable))
(snip!)
(do some interesting stuff in here)
(snip!)
Dim intSaveEvery As Integer
intSaveEvery = intSaveEvery + 1
If intSaveEvery >= intcSaveEveryDefault Then ' default is '5'
intSaveEvery = 0 ' reset counter
Documents(strFilesDocName).Save ' save the table of files
Else
End If
Wend
End Function
</pre>