• Files of Type in Dialogs

    Author
    Topic
    #351677

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #509751

      This works here:
      ChangeFileOpenDirectory “network drive if applicable
      With Dialogs(wdDialogFileOpen)
      .Name = “*.xls”
      .Show
      End With

      • #509753

        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.

        • #509790

          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.

          • #509815

            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.

    Viewing 0 reply threads
    Reply To: Files of Type in Dialogs

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: