Folder.Title property
Contains the title of the folder.
This property is read-only.
strTitle = Folder.Title
A string containing the object's title.
Note
Not all methods are implemented for all folders. For example, the ParseName method is not implemented for the Control Panel folder (CSIDL_CONTROLS). If you attempt to call an unimplemented method, a 0x800A01BD (decimal 445) error is raised.
The following example uses Title to retrieve the title of the folder holding the user's program groups (usually "Programs"). Proper usage is shown for JScript, VBScript, and 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
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
Header |
|
IDL |
|
DLL |
|