This is the Object Oriented way of doing what you request, and is now the preferred method using the VB file object:
If the function returns True then the file was created, if it returns false then the file already existed or an error occurred.
You must put a reference in to Microsoft Scripting Runtime, do this by selecting Project on the menu, click on References, find then tick Microsoft Scripting Runtime.
Private Function CreateFile(sFileName As String) As Boolean
On Error GoTo err_cmdCreateFile_Click
Dim oFileSystemObject As FileSystemObject
Dim oFolder As Folder
Dim oStream As TextStream
'You use the TextStream object to read and write
'to the file, experiment with it.
If sFileName = "" Then
sFileName = InputBox ("Enter a file name.", _
"Missing File Name"
End If
Set oFileSystemObject = CreateObject("Scripting.FileSystemObject"
'Check that the destination folder exists
'Replace Temp with any filepath name
If oFileSystemObject.FolderExists("C:\temp"

Then
Set oFolder = oFileSystemObject.GetFolder("C:\Temp"
Else
Set oFolder = oFileSystemObject.CreateFolder("C:\Temp"
End If
'Check does file exist
If oFileSystemObject.FileExists("C:\Temp\" & sFileName) Then
MsgBox "File already exists.", vbOKOnly
CreateFile = False
Else
Set oStream = oFileSystemObject.CreateTextFile _
("C:\Temp\" & sFileName, True, True)
CreateFile = True
End If
Set oStream = oFileSystemObject.CreateTextFile("C:\Temp\" _
& sFileName, True, True)
exit_CreateFile:
Set oFileSystemObject = Nothing
Exit Sub
err_CreateFile:
MsgBox "Error number " & Err.Number _
& Err.Description
CreateFile = False
GoTo exit_CreateFile
End Sub
Any problems let me know!
Derrick