Private Sub Form_Load()
'replace all the "c:\temp" below with your temp
directory
MsgBox GenTempName("c:\temp")
End Sub
Private
Function GenTempName(sPath As String)
Dim sPrefix As String
Dim lUnique As
Long
Dim sTempFileName As String
If IsEmpty(sPath) Then sPath = "c:\temp"
sPrefix = "fVB"
lUnique =
0
sTempFileName = Space$(100)
GetTempFileName sPath, sPrefix, lUnique,
sTempFileName
sTempFileName = Mid$(sTempFileName, 1, InStr(sTempFileName,
Chr$(0)) - 1)
GenTempName = sTempFileName
End Function