FolderItem.Verbs 方法
检索项目的 FolderItemVerbs 对象。 此对象是可对项执行的谓词的集合。
语法
retVal = FolderItem.Verbs()
参数
此方法没有任何参数。
返回值
类型: FolderItemVerbs**
对 FolderItemVerbs 对象的对象引用。
示例
以下示例使用 Verbs 检索 FolderItemVerbs 对象,该对象表示可在 Windows 文件夹上执行的谓词集。 显示 JScript、VBScript 和 Visual Basic 的正确用法。
Jscript:
<script language="JScript">
function fnFolderItemVerbsJ()
{
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 objItemVerbs;
objItemVerbs = objFolderItem.Verbs();
if (objItemVerbs != null)
{
// Add code here
}
}
}
}
</script>
VBScript:
<script language="VBScript">
function fnFolderItemVerbsVB()
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 objItemVerbs
set objItemVerbs = objFolderItem.Verbs
if (not objItemVerbs is nothing) then
'Add code here
end if
set objItemVerbs = nothing
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnFolderItemVerbsVB()
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 objItemVerbs As FolderItemVerbs
Set objItemVerbs = objFolderItem.Verbs
If (Not objItemVerbs Is Nothing) Then
'Add code here
End If
Set objItemVerbs = Nothing
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
要求
要求 | 值 |
---|---|
最低受支持的客户端 |
Windows 2000 专业版、Windows XP [仅限桌面应用] |
最低受支持的服务器 |
Windows 2000 Server [仅限桌面应用] |
标头 |
|
IDL |
|
DLL |
|
另请参阅