Link to home
Start Free TrialLog in
Avatar of MushyPeas
MushyPeas

asked on

CommonDialogBox: Show only files with NO extension

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
Avatar of Dang123
Dang123

MushyPeas,
   Try setting the filter to

*.

Dang123
Avatar of MushyPeas

ASKER

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.
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
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.
MushyPeas,
Please check your windows explorer settings. Is the "Hide extensions to known files ticked?"
Try unticking it

Dabas
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
ASKER CERTIFIED SOLUTION
Avatar of Dabas
Dabas
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Michelle:

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

Dabas
Well if you find a solution, make sure you post it here!
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