IShellDispatch.Open method

Opens the specified folder.

Syntax

IShellDispatch.Open(
  vDir
)

IShellDispatch.Open( _
  ByVal vDir As Variant _
)

Parameters

vDir [in]

Type: Variant

A string that specifies the path of the folder or one of the ShellSpecialFolderConstants values. Note that the constant names found in ShellSpecialFolderConstants are available in Visual Basic, but not in VBScript or JScript. In those cases, the numeric values must be used in their place.

If vDir is set to one of the ShellSpecialFolderConstants and the special folder does not exist, this function will create the folder.

Return value

JScript

This method does not return a value.

VB

This method does not return a value.

Remarks

This method is implemented and accessed through the Shell.Open method.

Examples

The following examples show the use of Open in JScript, VBScript, and Visual Basic.

JScript:

<script language="JScript">
    function fnShellOpenJ()
    {
        var objShell = new ActiveXObject("shell.application");
        var ssfWINDOWS = 36
        
        objshell.Open(ssfWINDOWS);
    }
</script>

VBScript:

<script language="VBScript">
    function fnShellOpenVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        objshell.Open("C:\")

        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnShellOpenVB()
    Dim objShell As Shell
    
    Set objShell = New Shell
    objshell.Open (ssfPERSONAL)

    Set objShell = Nothing
End Sub

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (version 4.71 or later)

See also

IShellDispatch

Explore