Folder2.Self-Eigenschaft
Enthält das FolderItem-Objekt des Ordners.
Diese Eigenschaft ist schreibgeschützt.
Syntax
Self = Folder2.Self
Eigenschaftswert
Das Objekt, das zum FolderItem-Objekt des Ordners ausgewertet wird.
Beispiele
Im folgenden Beispiel wird Self verwendet, um das FolderItem-Element für den Ordner C:\Windows abzurufen. Die ordnungsgemäße Verwendung wird für JScript, VBScript und Visual Basic angezeigt.
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
Anforderungen
Anforderung | Wert |
---|---|
Unterstützte Mindestversion (Client) |
Windows 2000 Professional, Windows XP [nur Desktop-Apps] |
Unterstützte Mindestversion (Server) |
Windows Server 2003 [nur Desktop-Apps] |
Header |
|
IDL |
|
DLL |
|
Siehe auch