Click to See Complete Forum and Search --> : File Dialog Box
Dubz
April 4th, 2001, 05:29 PM
Hello! I would like the user to be able to click a button and have a select file dialog box pop up with a directory already specified and a file extention locked in. I know this is possible and easy, just cant remember the way to call it.
Thanks!
cksiow
April 4th, 2001, 08:50 PM
I think what you need is a commondialog control.
you can set the file to be selected using filter property, e.g. if you only want to display text file
filter = text (*.txt)
you can call the method ShowOpen to pop up the dialog box.
hope this help.
cksiow
http://vblib.virtualave.net - share our codes
shree
April 4th, 2001, 10:49 PM
Place a commondialog control on your form, and name it cdbOpen
Then in code,
on error goto ErrHndlr
with cdbOpen
.CancelError=true
.Dialogtitle="Open a file"
.filter="Text Files (*.txt)|*.txt|All Files|*.*"
.initdir="c:\my documents"
.showopen
end with
'Do your work here
Exit sub
ErrHndlr:
'Cancel Was pressed
End sub
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.