Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Files of Type in Dialogs

    I think we've been over this before, but I just have to ask again because I don't recall a definitive answer:

    How do I control the Files of Type field when I

    Set dlg = Dialogs(wdDialogFileOpen)...

    I know if I .name = "" the All Word Files will display in the dialog window. But I want to display only Excel files in this Word dialog. Does anyone know how to do this?

    p.s. If I set .name = "*.xls" I get an erroneous message about network permissions. Then the folder opens anyway. See attachment.
    Attached Files Attached Files
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Files of Type in Dialogs

    This works here:
    ChangeFileOpenDirectory "<font color=blue>network drive if applicable</font color=blue>"
    With Dialogs(wdDialogFileOpen)
    .Name = "*.xls"
    .Show
    End With

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Files of Type in Dialogs

    Leif,
    Thanks for the response (TFTR).

    For some reason that I cannot see, that code (as straightforward as it is) does not work. Even though I didn't show the ChangeFileOpenDirectory statement in my post, it's in my code. Furthermore, the .Name prop really only affects the filename field (as I understand it), not the Files of Type field on the open dialog form -- at least not in my part of the globe. I think I'll just let it go. The user can live with it if All Files are displayed.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Files of Type in Dialogs

    I suspect the problem is that the Word dialogs are prepackaged wrappers over the WinAPI GetOpenFileNameA call. If you use the WinAPI, ugly as it is, you should be able to set the file type as well as the extension. The FMS, Inc. Total Source Book (or whatever they call it now that they combined Access and VB in it) has prewritten code for handling the GetOpenFileNameA calls.
    Charlotte

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Files of Type in Dialogs

    I did spend some time working with the API Common dialogs. I forget now why I pitched the idea. But I suspect you are right. That's the only way I'm going to get a handle on this. Thanks.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •