Méthode FolderItems2. InvokeVerbEx
Exécute un verbe sur une collection d’objets FolderItem . Cette méthode est une extension de la méthode InvokeVerb , qui permet un contrôle supplémentaire de l’opération via un ensemble d’indicateurs.
Syntaxe
iRetVal = FolderItems2.InvokeVerbEx(
[ vVerb ],
[ vArgs ]
)
Paramètres
-
vVerb [ dans, facultatif]
-
Type : variante
Variant avec la chaîne de verbe qui correspond à la commande à exécuter. Si aucun verbe n’est spécifié, le verbe par défaut est exécuté.
-
vArgs [ dans, facultatif]
-
Type : variante
Variant qui se compose d’une chaîne avec un ou plusieurs arguments de la commande spécifiée par vVerb. Le format de cette chaîne dépend du verbe particulier.
Notes
Un verbe est une chaîne utilisée pour spécifier une action particulière associée à un élément ou à une collection d’éléments. En règle générale, l’appel d’un verbe lance une application associée. par exemple, l’appel du verbe open sur un fichier .txt ouvre normalement le fichier avec un éditeur de texte, généralement Microsoft Bloc-notes. Pour plus d’informations sur les verbes, consultez lancement d’applications.
Exemples
L’exemple suivant utilise InvokeVerbEx pour appeler le verbe par défaut (« Open ») sur poste de travail. l’utilisation appropriée est indiquée pour JScript, VBScript et Visual Basic.
JScript :
<script language="JScript">
function fnFolderItems2InvokeVerbExJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder;
var ssfDRIVES = 17;
objFolder = objShell.NameSpace(ssfDRIVES);
if (objFolder != null)
{
var objFolderItems2;
objFolderItems2 = objFolder.Items();
if (objFolderItems2 != null)
{
objFolderItems2.InvokeVerbEx();
}
}
}
</script>
VBScript
<script language="VBScript">
function fnFolderItems2InvokeVerbExVB()
dim objShell
set objShell = CreateObject("shell.application")
if (not objShell is nothing) then
dim objFolder
dim ssfDRIVES
ssfWINDOWS = 17
set objFolder = objShell.NameSpace(ssfWINDOWS)
if (not objFolder is nothing) then
dim objFolderItems2
set objFolderItems2 = objFolder.Items()
if (not objFolderItems2 is nothing) then
objFolderItems2.InvokeVerbEx
end if
set objFolderItems2 = nothing
end if
set objFolder = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic :
Private Sub fnFolderItems2InvokeVerbExVB()
Dim objShell As Shell
Dim objFolder As Folder2
Dim ssfDRIVES As Long
ssfDRIVES = 17
Set objShell = New Shell
Set objFolder = objShell.NameSpace(ssfDRIVES)
If (Not objFolder Is Nothing) Then
Dim objFolderItems2 As FolderItems
Set objFolderItems2 = objFolder.Items
If (Not objFolderItems2 Is Nothing) Then
objFolderItems2.InvokeVerbEx
End If
Set objFolderItems2 = Nothing
End If
Set objFolder = Nothing
Set objShell = Nothing
End Sub
Spécifications
| Condition requise | Valeur |
|---|---|
| Client minimal pris en charge |
Windows 2000 Professional, Windows XP [ desktop apps uniquement] |
| Serveur minimal pris en charge |
Windows Serveur 2003 [ applications de bureau uniquement] |
| En-tête |
|
| MIDL |
|
| DLL |
|