Proprietà FolderItem.Parent
Ottiene un oggetto che rappresenta l'elemento padre dell'elemento.
Questa proprietà è di sola lettura.
Sintassi
objParent = FolderItem.Parent
Valore proprietà
Variabile di tipo IDispatch che riceve l'oggetto padre.
Esempio
Nell'esempio seguente viene illustrato l'uso corretto di Parent per JScript, VBScript e Visual Basic.
Jscript:
<script language="JScript">
function fnFolderItemParentJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfWINDOWS = 36;
objFolder2 = objShell.NameSpace(ssfWINDOWS);
if (objFolder2 != null)
{
var objFolderItem;
objFolderItem = objFolder2.Self;
{
var objParent;
objParent = objFolderItem.Parent;
if (objParent != null)
{
alert("Got parent object");
}
}
}
}
</script>
Vbscript:
<script language="VBScript">
function fnFolderItemParentVB()
dim objShell
dim objFolder2
dim ssfWINDOWS
ssfWINDOWS = 36
set objShell = CreateObject("shell.application")
set objFolder2 = objShell.NameSpace(ssfWINDOWS)
if (not objFolder2 is nothing) then
dim objFolderItem
set objFolderItem = objFolder2.Self
if (not objFolderItem is nothing) then
dim objParent
set objParent = objFolderItem.Parent
if (not objParent is nothing) then
alert("Got parent object")
end if
set objParent = nothing
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
set objShell = nothing
end function
</script>
Visual Basic:
<script language="JScript">
function fnFolderItemParentJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfWINDOWS = 36;
objFolder2 = objShell.NameSpace(ssfWINDOWS);
if (objFolder2 != null)
{
var objFolderItem;
objFolderItem = objFolder2.Self;
{
var objParent;
objParent = objFolderItem.Parent;
if (objParent != null)
{
alert("Got parent object");
}
}
}
}
</script>
Requisiti
Requisito | Valore |
---|---|
Client minimo supportato |
Windows 2000 Professional, Windows XP [solo app desktop] |
Server minimo supportato |
Windows 2000 Server [solo app desktop] |
Intestazione |
|
IDL |
|
DLL |
|