Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Web
Expertise: Beginner
Feb 5, 2003



Application Security Testing: An Integral Part of DevOps

VBScript for "ShowOpenDialog"

Ever want to use the Common Dialog "ShowOpenDialog" but were frustrated because it required that Visual Studio be installed on each user's PC?

Here's an alternative written in VBScript that can be used in WSH scripts or ASP pages.

To test, save as "Browse4.vbs" then double-click it.
Option Explicit
Const cVBS = "BrowseFor.vbs"

MsgBox BrowseForFolder("File","Browse a File")
MsgBox BrowseForFolder("Folder","Browse a Folder")

Function BrowseForFolder(sBFF,sPMT)
    BrowseForFolder = ""
    If sBFF <> "Folder" And sBFF <> 
"File" Then Exit Function
    Dim objSHL
    Set objSHL = CreateObject("Shell.Application")
    Dim objB4F
    On Error Resume Next
    If sBFF = "Folder" Then
        Set objB4F = 
        Set objB4F = 
    End If
    BrowseForFolder = 
    If Err.Number <> 0 Then BrowseForFolder = ""
    Set objB4F = Nothing
    Set objSHL = Nothing
End Function
Douglas McKirahan
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date