Open File API-call Multiple selections

G

Gert

I found the information wrt. this topic very helpfull. However, I have two
extra questions:
- When a file-name contains a space, it is not correctly displayed. For my
application, it is important that the filenames are correct. Can this be
solved?
- The number of files you can select is limited to about 20. I woul like to
extend this to 200. Is this possible?

Thanks in advance,
Gert
 
K

Klatuu

First, it is poor form to use spaces in any names. Names should be limited
to letters, numbers, and the underscore character.

I don't know of any way to increase the number of files you can select.
Which API are you using?
 
K

Klatuu

I assume you are setting this flag:
ahtOFN_ALLOWMULTISELECT

Now, I haven't experimented with this, but in the tagOPENFILENAME Type
declaration, there is an item named nMaxFile

I would suggest playing around with that and see if setting that to a
specific value would do any good. As I say, I don't know, but that would be
where I start experimenting.
 
K

Klatuu

I just did a quick test with it, and that will not get it done. It is used
for something else.
 
G

Gert

I think the answer to the question is in the variable "strFileName" it's
length is decreased to 256 characters, whic would account for the path-string
and about 20 filenames. Do you know why this variable is reduced to 256
characters?
 
G

Gert

Found it:

If you change the allocated string space in the section below from 256 to
2560, the number of files that can be selected is about 10-fold.

' Allocate string space for the returned strings.
strFileName = Left(FileName & String(256, 0), 256)
strFileTitle = String(256, 0)

Thanks for the help
Gert
 
G

Gert

Any suggestions on the first part of my question? (the part about filenames
with spaces)
 
D

Douglas J. Steele

I've never noticed a problem with spaces in filenames when using
multi-select.

What's the exact code you're using, and what displays when you've got a
filename with a space (vs. what should display)?
 
D

Douglas J. Steele

I just copied the code into a new module. It returned
"C:\Users\DJSteele\Documents\Long File Name.txt" as the selected file name
to me. (For this particular test, I was using Access 2003 under Vista)

What's the exact code you're using to call the function?
 
Top