Propriété Folder2.Self
Contient l’objet FolderItem du dossier.
Cette propriété est en lecture seule.
Syntaxe
Self = Folder2.Self
Valeur de la propriété
Objet qui correspond à l’objet FolderItem du dossier.
Exemples
L’exemple suivant utilise Self pour récupérer l’objet FolderItem pour le dossier C:\Windows. Une utilisation correcte est indiquée pour JScript, VBScript et Visual Basic.
Jscript:
<script language="JScript">
function fnFolder2ObjectSelfJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2 = new Object;
objFolder2 = objShell.NameSpace("C:\\WINDOWS");
if (objFolder2 != null)
{
var objFolderItem = new Object;
objFolderItem = objFolder2.Self;
if (objFolderItem != null)
{
//Add code here.
}
}
}
</script>
Vbscript:
<script language="VBScript">
function fnFolder2ObjectSelfVB()
dim objShell
dim objFolder2
set objShell = CreateObject("shell.application")
set objFolder2 = objShell.NameSpace("C:\WINDOWS")
if (not objFolder2 is nothing) then
dim objFolderItem
set objFolderItem = objFolder2.Self
if (not objFolderItem is nothing) then
'Add code here.
end if
end if
set objFolder2 = nothing
set objShell = nothing
end function
</script>
Visual Basic :
Private Sub btnFolder2Self_Click()
Dim objShell As Shell
Dim objFolder2 As Folder2
Set objShell = New Shell
Set objFolder2 = objShell.NameSpace("C:\WINDOWS")
If (Not objFolder2 Is Nothing) Then
Dim objFolderItem As FolderItem
Set objFolderItem = objFolder2.Self()
If (Not objFolderItem Is Nothing) Then
'Add code here.
End If
Set objFolderItem = 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 Server 2003 [applications de bureau uniquement] |
En-tête |
|
IDL |
|
DLL |
|
Voir aussi