Propriété FolderItem.Type
Contient une représentation sous forme de chaîne du type de l’élément.
Cette propriété est en lecture seule.
Syntaxe
strType = FolderItem.Type
Valeur de la propriété
Variable de type BSTR qui reçoit le type de l’élément.
Exemples
L’exemple suivant utilise Type pour récupérer le type de l’élément. Une utilisation correcte est indiquée pour JScript, VBScript et Visual Basic.
Jscript:
<script language="JScript">
function fnFolderItemTypeJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfWINDOWS = 36;
objFolder2 = objShell.NameSpace(ssfWINDOWS);
if (objFolder2 != null)
{
var objFolderItem;
objFolderItem = objFolder2.Self;
if (objFolderItem != null)
{
var szReturn;
szReturn = objFolderItem.Type;
alert(szReturn);
}
}
}
</script>
Vbscript:
<script language="VBScript">
function fnFolderItemTypeVB()
dim objShell
set objShell = CreateObject("shell.application")
if (not objShell is nothing) then
dim objFolder2
dim ssfWINDOWS
ssfWINDOWS = 36
set objFolder2 = objShell.NameSpace(ssfWINDOWS)
if (not objFolder2 is nothing) then
dim objFolderItem
set objFolderItem = objFolder2.Self
if (not objFolderItem is nothing) then
dim szReturn
szReturn = objFolderItem.Type
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic :
Private Sub fnFolderItemTypeVB()
Dim objShell As Shell
Dim objFolder2 As Folder2
Dim ssfWINDOWS As Long
ssfWINDOWS = 36
Set objShell = New Shell
Set objFolder2 = objShell.NameSpace(ssfWINDOWS)
If (Not objFolder2 Is Nothing) Then
Dim objFolderItem As FolderItem
Set objFolderItem = objFolder2.Self
If (Not objFolderItem Is Nothing) Then
Dim szReturn As String
szReturn = objFolderItem.Type
Else
'FolderItem object returned nothing.
End If
Set objFolderItem = Nothing
Else
'Folder object returned nothing.
End If
Set objFolder2 = Nothing
Set objShell = Nothing
End Sub
Spécifications
Condition requise | Valeur |
---|---|
Client minimal pris en charge |
Windows 2000 Professionnel, Windows XP [applications de bureau uniquement] |
Serveur minimal pris en charge |
Windows 2000 Server [applications de bureau uniquement] |
En-tête |
|
IDL |
|
DLL |
|