Displaying a FileOpen dialog in desired sort order

R

Roy Lasris

I want to be able to select the sort order of a dialog via VBA. Displaying the
directory is easy, but I am stuck with the default (seems to be last used) sort
order. There doesn't appear to be a sort order option in the various VBA
commands that control file opening. How can I automatically display the dialog
let's say in name or date (most recent on top) order without having to click
the name or size or date column once the dialog displays.
===========
With Dialogs(wdDialogFileOpen)
.name = "*.doc"
.SORTBY ="date" or "name" or "size" <-something like this doesn't seem to
exist
.Show
End With
============

Maybe there is a SendKeys command?

Thanks,

Roy
 
P

Perry

Office XP onward, use

Dim d As FileDialog

Set d = Application.FileDialog(msoFileDialogOpen)
d.InitialView = msoFileDialogViewDetails
d.Show

In the Details view, the files/folders are sorted and the user
can choose to apply other file/folder attributes to sort ...

Krgrds,
Perry
 
R

Roy Lasris

Perry,
I am not sure that that did anything much different that the other command that
I had posted, but I was not aware that that "mso" command, and its options
existed. Thanks for the heads up. I had used a different technique for
'folderpicking" but I see that msoFileDialogFolderPicker is one of the dialog
options. Cool. I really needed that.

Roy
 

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