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

Re: Displaying a FileOpen dialog in desired sort order by Perry

Perry
Sun Jan 25 07:24:33 CST 2004

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

"Roy Lasris" <asrisl@aol.com> wrote in message
news:20040125081037.13501.00000570@mb-m24.aol.com...
> 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