Bagikan melalui


Properti Folder.Title

Berisi judul folder.

Properti ini bersifat hanya baca.

Sintaks

strTitle = Folder.Title

Nilai properti

String yang berisi judul objek.

Keterangan

Catatan

Tidak semua metode diimplementasikan untuk semua folder. Misalnya, metode ParseName tidak diimplementasikan untuk folder Panel Kontrol (CSIDL_CONTROLS). Jika Anda mencoba memanggil metode yang tidak diratakan, kesalahan 0x800A01BD (desimal 445) akan muncul.

 

Contoh

Contoh berikut menggunakan Judul untuk mengambil judul folder yang memegang grup program pengguna (biasanya "Program"). Penggunaan yang tepat ditampilkan untuk JScript, VBScript, dan Visual Basic.

Jscript:

<script language="JScript">
    function fnFolderTitleJ()
    {
        var objShell    = new ActiveXObject("shell.application");
        var objFolder;
        var ssfPROGRAMS = 2;
        
        objFolder = objShell.NameSpace(ssfPROGRAMS);
        if (objFolder != null)
        {
            alert(objFolder.Title);
        }
    }
</script>

Vbscript:

<script language="VBScript">
    function fnFolderTitleVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        if (not objShell is nothing) then
            dim objFolder
            dim ssfPROGRAMS
            
            ssfPROGRAMS = 2
            set objFolder = objShell.NameSpace(ssfPROGRAMS)
            if (not objFolder is nothing) then
                alert(objFolder.Title)
            end if
            set objFolder = nothing
        end if
        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnFolderTitleVB()
    Dim objShell    As Shell
    Dim objFolder   As Folder
    Dim ssfPROGRAMS As Long
            
    ssfPROGRAMS = 2
    Set objShell = New Shell
    Set objFolder = objShell.NameSpace(ssfPROGRAMS)
    If (Not objFolder Is Nothing) Then
        Debug.Print objFolder.Title
    End If
    Set objFolder = Nothing
    Set objShell = Nothing
End Sub

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung
Windows 2000 Professional, Windows XP [hanya aplikasi desktop]
Server minimum yang didukung
Windows 2000 Server [hanya aplikasi desktop]
Header
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (versi 4.71 atau yang lebih baru)