Browse Button

Closed
sat - Aug 19, 2009 at 07:03 AM
 Blocked Profile - Aug 19, 2009 at 08:28 AM
Hello,
i m new to vb script..actually in VBscript i want to create a browse button in the input box inorder to browse my files stored in the lcation..so i need the code for that..

1 response

Blocked Profile
Aug 19, 2009 at 08:28 AM
Hello Sir,

This is the command to create a browse button:

On Error Resume Next
Const BIF_EDITBOX = &H10
Const BIF_NEWDIALOGSTYLE = &H40
Set sa = CreateObject("Shell.Application")
Set oF = sa.BrowseForFolder(0, "My Computer:",_
BIF_EDITBOX Or BIF_NEWDIALOGSTYLE)

oFolder = oF.Items.Item.path
If Err.Number > 0 Then
MsgBox("You have not selected a folder." & vbCrlf &_
"This script will not continue!")
Err.Clear
Else
wscript.echo oFolder
End If


Hope this works for you

Thanks
1