我使用了FSO在指定目录下建立了一个文件夹可问题又来了。
如何判断新建立的文件夹与原有的文件夹是否重名呢?
-------------------------------------------------
判断文件夹是否存在就行了
Function ReportFolderStatus(fldr)
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
msg = fldr & " 存在。"
Else
msg = fldr & " 不存在。"
End If
ReportFolderStatus = msg
End Function
例:
Function CreateFolderDemo
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder("c:\New Folder")
CreateFolderDemo = f.Path
End Function
例:
Function CreateFolderDemo
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder("c:\New Folder")
CreateFolderDemo = f.Path
End Function