返回文件或文件夾的類型信息。例如,對于擴展名為 .TXT 的文件,返回“Text Document”。
object.Type
object 應為 File 或 Folder 對象的名稱。
以下代碼舉例說明如何使用 Type 屬性返回文件夾的類型。在此示例中,試圖向過程提供“回收站”或其他唯一文件夾的路徑。
Function ShowFolderType(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(filespec) s = UCase(f.Name) & "
的類型為" & f.Type
End Function
ShowFolderType = s
新聞熱點
疑難解答
圖片精選