Home All Groups Group Topic Archive Search About

VBA 2003 FileOpen DialogBox View Details

Author
10 May 2007 8:41 PM
GrandpaRay
Is there a way to specify the "view details" option when opening a Common
Dialog Box to show the user file modified dates, sizes , etc.?

    DialogCaption = "Select Your Meds File - "

    frmOpenDlg.dlgOpenFile.DialogTitle = DialogCaption

    ' Set the Open File dialog box to display *.doc files.
    frmOpenDlg.dlgOpenFile.Filter = _
        "Beth Meds File (BethMed*.Doc)|BethMed*.doc"

    frmOpenDlg.dlgOpenFile.InitDir = _
        "c:\Documents and Settings\GrandpaRay\My Documents\Meds"

    ' Display the File Open dialog box.
    frmOpenDlg.dlgOpenFile.MaxFileSize = 15000
    frmOpenDlg.dlgOpenFile.FilterIndex = 1
    frmOpenDlg.dlgOpenFile.Flags = cdlOFNReadOnly Or cdlOFNFileMustExist _
        Or cdlOFNLongNames _
        Or cdlOFNExplorer
    frmOpenDlg.dlgOpenFile.CancelError = True
    frmOpenDlg.dlgOpenFile.FileName = ""
    On Error Resume Next
    frmOpenDlg.dlgOpenFile.ShowOpen

    If Err <> 0 Then
        MsgBox "Open Dialog ERR:" & Err _
            & vbCrLf & "Err.Number:" & Err.Number _
            & vbCrLf & "Err.Description:" & Err.Description _
            & vbCrLf & "Err.Source:" & Err.Source
        ' No file selected from the Open File dialog box.
      'VBA.Err.Number = rCaughtErr.Number
      'VBA.Err.Description = rCaughtErr.Description
      'VBA.Err.Source = rCaughtErr.Source

        Exit Sub
    End If
    MedsFileName = Trim(frmOpenDlg.dlgOpenFile.FileName)
    MsgBox "Meds File Selected Is " & MedsFileName

Thanks,

--
Grandpa Ray

Author
10 May 2007 9:00 PM
Jeff Johnson
"GrandpaRay" <Grandpa***@discussions.microsoft.com> wrote in message
news:8AC3265C-F4F5-463D-83B7-5E3F91CED5CF@microsoft.com...

> Is there a way to specify the "view details" option when opening a Common
> Dialog Box to show the user file modified dates, sizes , etc.?

http://vbnet.mvps.org/code/hooks/fileopensavedlghooklvview.htm
Author
11 May 2007 1:24 AM
GrandpaRay
That sample Jeff works fine in VB6 but I can't make it work in a VBA 2003
listbox control. Am I missing a reference to supply the proper listbox?
--
Grandpa Ray


Show quoteHide quote
"Jeff Johnson" wrote:

> "GrandpaRay" <Grandpa***@discussions.microsoft.com> wrote in message
> news:8AC3265C-F4F5-463D-83B7-5E3F91CED5CF@microsoft.com...
>
> > Is there a way to specify the "view details" option when opening a Common
> > Dialog Box to show the user file modified dates, sizes , etc.?
>
> http://vbnet.mvps.org/code/hooks/fileopensavedlghooklvview.htm
>
>
>
Author
11 May 2007 1:42 PM
Jeff Johnson
"GrandpaRay" <Grandpa***@discussions.microsoft.com> wrote in message
news:3805EF9B-B281-4F86-8315-1E98B27A71B4@microsoft.com...

> That sample Jeff works fine in VB6 but I can't make it work in a VBA 2003
> listbox control. Am I missing a reference to supply the proper listbox?

This group (and the site I sent you to) is for the standalone version of VB.
VBA is very similar but there are enough differences that we generally
redirect people who ask VBA questions to the groups for the product they're
writing their code under (Word, Excel, etc.). Sorry I didn't notice VBA in
the subject line the first time around.

And more than likely you won't be able to do what you want because those
programs are already hooking their Open dialogs to add stuff. But I guess
it's possible.
Author
11 May 2007 2:36 PM
GrandpaRay
Jeff,
Thanks for the info. I have noticed that the controls in VBA tend to not be
as robust as those in VB.
--
Grandpa Ray


Show quoteHide quote
"Jeff Johnson" wrote:

> "GrandpaRay" <Grandpa***@discussions.microsoft.com> wrote in message
> news:3805EF9B-B281-4F86-8315-1E98B27A71B4@microsoft.com...
>
> > That sample Jeff works fine in VB6 but I can't make it work in a VBA 2003
> > listbox control. Am I missing a reference to supply the proper listbox?
>
> This group (and the site I sent you to) is for the standalone version of VB.
> VBA is very similar but there are enough differences that we generally
> redirect people who ask VBA questions to the groups for the product they're
> writing their code under (Word, Excel, etc.). Sorry I didn't notice VBA in
> the subject line the first time around.
>
> And more than likely you won't be able to do what you want because those
> programs are already hooking their Open dialogs to add stuff. But I guess
> it's possible.
>
>
>