| FolderExists 方法 |
|
FolderExists 方法的语法有以下部分:
| 部分 | 描述 |
| object | 必选。应为 FileSystemObject 的名称。 |
| folderspec | 必选。文件夹名称,表示要确定是否存在的文件夹。如果该文件夹不在当前文件夹中,则必须提供完整路径名(绝对路径或相对路径)。 |
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