Solved

CommonDialogBox: Show only files with NO extension

Posted on 2003-12-03
12
230 Views
Last Modified: 2010-05-01
Any idea of how I can get the CDB to only list files that DON'T have an extension?  Tried using the filter, but haven't got it to work?

Ta
0
Comment
Question by:MushyPeas
  • 6
  • 5
12 Comments
 
LVL 9

Expert Comment

by:Dang123
ID: 9874309
MushyPeas,
   Try setting the filter to

*.

Dang123
0
 
LVL 1

Author Comment

by:MushyPeas
ID: 9878307
Nope.. doesn't work.  I'm beginning to thnk I've found the impossible!  Shame, I have to use *.* and that shows ALL the files, so then users got to trawl through them all.
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9878339
Hi MushyPeas,
It depends what you meen by Don't have an extension?
Something like File1 as opposed to File1.txt

Or you want something like "all files except the ones that have extension .doc"

If its the former, then Dang's answer looks correct to me


Dabas
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:MushyPeas
ID: 9878425
Hmm.... I do want to display files like File1, not File1.txt.  I changed the filter to:

    .Filter = "Risk Manager Backup Files (*.rmb)|*.rmb;*.|All files (*.*)|*.*"

and then to:

    .Filter = "Risk Manager Backup Files |*.|All files (*.*)|*.*"

But neither worked.  I don't see ANY files if I'm using the *. filter.  

I tried duplicating the same thing in Word and it DOES work via word, but not using the Visual Basic 6 Common Dialog box.
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9878474
MushyPeas,
Please check your windows explorer settings. Is the "Hide extensions to known files ticked?"
Try unticking it

Dabas
0
 
LVL 1

Author Comment

by:MushyPeas
ID: 9878506
No, it's definately not ticked - I hate that setting!  Besides, it does work in Word.  Does it work for you in VB?  Maybe there's some flag I'm supposed to be setting

Michelle
0
 
LVL 27

Accepted Solution

by:
Dabas earned 50 total points
ID: 9878580
MushyPeas,

No it does not work in VB. Must be a bug
I also tried * (alone), *.? *.(space)

You can overcome the problem by using the filesystemobject and creating your own common dialog.

It is not as difficult as it seems!
Dabas
0
 
LVL 27

Assisted Solution

by:Dabas
Dabas earned 50 total points
ID: 9878611
Michelle:

I tried in VB.NET and same problem!

Interesting!

Daniel
0
 
LVL 1

Author Comment

by:MushyPeas
ID: 9878654
Interesting?  Frustrating!!  I've split the points, hope that's fair.  As for fso - could, but can't be bothered - users will have to cope for the moment.
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9878668
Michelle:

If you split the points, I benefited from both sides of the split! :-)}
I have not given up on this issue yet!

Dabas
0
 
LVL 1

Author Comment

by:MushyPeas
ID: 9878699
Well if you find a solution, make sure you post it here!
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9878842
Michelle:

Sorry, but no luck.
I think that part of the problem is caused by most folders also being of the *. type. Since the commond dialog shows you the folder list, they might have programmed it to ignore the *. filter.

FSO would be the way to go with your own custom dialog box. As mentioned earlier it is not as hard as it looks like.

Good luck!

Daniel
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question