Results 1 to 10 of 10

FileDialog Properties

Threaded View

jlt199 FileDialog Properties 05-07-2010, 05:58 PM
JBeaucaire Re: FileDialog Properties 05-07-2010, 06:30 PM
jlt199 Re: FileDialog Properties 05-07-2010, 06:33 PM
JBeaucaire Re: FileDialog Properties 05-07-2010, 06:41 PM
jlt199 Re: FileDialog Properties 05-07-2010, 06:49 PM
JBeaucaire Re: FileDialog Properties 05-07-2010, 06:41 PM
broro183 Re: FileDialog Properties 05-08-2010, 12:33 PM
JBeaucaire Re: FileDialog Properties 06-16-2010, 07:20 PM
jlt199 Re: FileDialog Properties 06-16-2010, 07:41 PM
JBeaucaire Re: FileDialog Properties 06-17-2010, 02:53 AM
  1. #1
    Forum Contributor
    Join Date
    03-19-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Office 2013, Office 365 Pro Plus
    Posts
    182

    FileDialog Properties

    Hi again,

    I have another question!

    I have written this function to open a dialog box to allow the user to select the text file to read

    Function getFile() As String
        Dim fd As FileDialog
        Dim ffs As FileDialogFilters
        Dim fname As String
        
        
        Set fd = Application.FileDialog(msoFileDialogOpen)
        
        With fd
            Set ffs = .Filters
            
            With ffs
                .Clear
                .Add "Text Files", "*.txt"
            End With
            
            .AllowMultiSelect = False
            
            If .Show = False Then Exit Function
            
            getFile = .SelectedItems(1)
        End With
    End Function
    which works fine. My question is, how can I update this function to also allow files without extensions to be shown?

    The researcher who will be applying my macro usually forgets to save the data in a .txt file and instead leaves them without extensions.

    I'm currently running the function without the line
     .Add "Text Files", "*.txt"
    which shows all files, but if the folder in question contains a lot of other files this seems needlessly messy.

    Many thanks
    Last edited by jlt199; 05-07-2010 at 06:40 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1