Pages

Tuesday, 18 October 2011

Create Unique File Name


' =============================================================
' function: UniqueFileName
' desc : Creates a unique file name
' params : strType - file extension
' returns : unique file name of specified type
' =============================================================
Function UniqueFileName(strType)

dim strReturn

' make sure there is a dot before the type
If left(strType,1<> "." then strType = "." & strType

' create the file name using the date & time, and remove the / and : chars
strReturn = day(date& month(date& year(date& hour(time& minute(time& second(time& strType

' return the file name
UniqueFileName = strReturn

End Function 'UniqueFileName

0 comments:

Post a Comment