下面例子舉例說明如何使用 FolderExists 方法:
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