Metodo FolderItemVerb.DoIt

Esegue un verbo nell'oggetto FolderItem associato al verbo.

Sintassi

FolderItemVerb.DoIt()

Parametri

Questo metodo non presenta parametri.

Valore restituito

Questo metodo non restituisce valori.

Esempio

Nell'esempio seguente viene utilizzato DoIt per eseguire il primo verbo nella raccolta di verbi a cui risponde la cartella Program dell'utente. Viene visualizzato un utilizzo appropriato per JScript, VBScript e Visual Basic.

Jscript:

<script language="JScript">
    function fnFolderItemVerbDoItJ()
    {
        var objShell    = new ActiveXObject("shell.application");
        var objFolder;
        var ssfPROGRAMS = 2;
        
        objFolder = objShell.NameSpace(ssfPROGRAMS);
        if (objFolder != null)
        {
            var objVerbs;
            
            objVerbs = objFolder.Self.Verbs();
            if (objVerbs != null)
            {
                objVerbs.Item(0).DoIt();
            }
        }
    }
</script>

Vbscript:

<script language="VBScript">
    function fnFolderItemVerbDoItVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        if (not objShell is nothing) then
            dim objFolder
            dim ssfPROGRAMS
            
            ssfPROGRAMS = 2
            set objFolder = objShell.NameSpace(ssfPROGRAMS)
            if (not objFolder is nothing) then
                dim objVerbs
                
                set objVerbs = objFolder.Self.Verbs
                    if (not objVerbs is nothing) then
                        objVerbs.Item(0).DoIt
                    end if
                set objVerbs = nothing
            end if
            set objFolder = nothing
        end if
        set objShell = nothing
    end function
</script>

Visual Basic:

Private Sub fnFolderItemVerbDoItVB()
    Dim objShell    As Shell
    Dim objFolder2  As Folder2
    Dim ssfPROGRAMS As Long
            
    ssfPROGRAMS = 2
    Set objShell = New Shell
    Set objFolder2 = objShell.NameSpace(ssfPROGRAMS)
    If (Not objFolder2 Is Nothing) Then
        Dim objVerbs As FolderItemVerbs
        
        Set objVerbs = objFolder2.Self.Verbs
            If (Not objVerbs Is Nothing) Then
                objVerbs.Item(0).DoIt
            End If
        Set objVerbs = Nothing
    End If
    Set objFolder2 = Nothing
    Set objShell = Nothing
End Sub

Requisiti

Requisito Valore
Client minimo supportato
Windows 2000 Professional, Windows XP [solo app desktop]
Server minimo supportato
Windows 2000 Server [solo app desktop]
Intestazione
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (versione 4.71 o successiva)