Controlling scroll bars in file dialog

G

Guest

Does anybody have any idea how to control the scroll bars in the file dialog
that would appear when you want to open a file or multiple files.

Basicailly, I'd like the scroll bar to be at the beginning the first time
it's run. Then each subsequent time the macro runs, it would record the last
position of the file list and use it the next time open is called.

I found doc's for controlling the scroll bars of your own list boxes, but
how to control the system open scroll bars baffles me.
 
N

NickHK

With the Open dialog, you have no option to set the initial name and
therefore no hope to preselect a file and move the scroll-bars. The
GetSaveAsFilename, does have an initialname property, but does not select
the file anyway.
The main problem is that because you are showing a Dialog, it is shown
modally; hence no code runs until it is dismissed.

To me, the easiest solution would be to make you own (simplified) file
dialog userform, then you can control any and all aspects of its behaviour.
Use a listview control to get the same look as the standard Windows dialogs.
The alternative is supplying a hook to the Windows GetOpenFileName API and
use SendMessage to make your changes. Note that this method substantially
more complex the solution above.

But with MultiSelect set to True, can the user not select all the files
needed in one go ?

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top