|
-
Aug 21st, 2000, 08:49 AM
#1
Thread Starter
Lively Member
I am looking for a way that a user can supply a wildcard to define certian files that he/she wants from a directory. dlgCommonDialog.ShowOpen allows the user to choose one file, BUT how does the user supply a wildcard so that, for example, they can choose every *.txt file within a directory? dlgCommonDialog.ShowOpen only allows one file and no wildcards. Could there be a varible or a command that I can add to dlgCommonDialog.ShowOpen to allow wildcards to be accepted? Or is there something else. If you could help me, that would be wonderful!!! THANKS!
~Brian Schwartz
[email protected]
-
Aug 21st, 2000, 09:06 AM
#2
Sure just add the cdlOFNNoValidate flag option:
Code:
With CommonDialog1
.Flags = cdlOFNNoValidate '+ other flag values you want to set
.ShowOpen
MsgBox .FileName
End With
Good luck!
-
Aug 21st, 2000, 11:48 AM
#3
You can allow the user to specify multiple files by using the cdlOFNAllowMultiselect flag. Specifies that the File Name list box allows multiple selections.
The user can select more than one file at run time by pressing the SHIFT key and using the UP ARROW and DOWN ARROW keys to select the desired files. When this is done, the FileName property returns a string containing the names of all selected files. The names in the string are delimited by spaces.
Code:
With CommonDialog1
.Flags = cdlOFNAllowMultiselect '+ other flag values you want to set
.ShowOpen
MsgBox .FileName
End With
"It's cold gin time again ..."
Check out my website here.
-
Aug 22nd, 2000, 06:26 AM
#4
Yes setting the cldOFNAllowMultiselect flag will permit you to select several files in the CommonDialog control but it doesn't allow you to type in wildchars.
-
Aug 22nd, 2000, 07:59 AM
#5
Thread Starter
Lively Member
Thank you for your help! It has helped me do more with the common dialog box, and perform the things that I want to do. Can I use both flags though? The cdlOFNAllowMultiselect and the cdlOFNNoValidate ... can they be used at the same time?
-
Aug 22nd, 2000, 09:07 AM
#6
Yes you can just add them together.
Code:
CommonDialog1.Flags = cdlOFNAllowMultiselect + cdlOFNNoValidate
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|