Results 1 to 7 of 7
  1. #1
    fritesmodern is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    13

    FileDialog with filters

    I would like to open the Windows Filedialog by Access VBA with the following filters:

    -show only pdf and jpg files
    -show only file names containing the ‘letter’ in the file name.


    -show only files located in C:\MYDIRECTORY\MYSUBDIRECTORY
    -show only files modified between 10/12/2014 and 10/17/2014

    Can anybody post a sample to accomplish all of the above?

    Thank in advace

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,840
    see this link

    https://msdn.microsoft.com/en-us/lib.../ff196794.aspx

    e.g.

    .Filters.Add "PDF", "*.pdf"
    .Filters.Add "JPG", "*.jpg"

    show only file names containing the ‘letter’ in the file name+
    show only files located in C:\MYDIRECTORY\MYSUBDIRECTORY - perhaps use initial file name e.g..InitialFileName = "Z:\docs\*t*.*x*"

    -show only files modified between 10/12/2014 and 10/17/2014 - don't know suggest google 'filedialog filters'

  3. #3
    fritesmodern is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    13

    No success forr

    Thanks for your response.

    I have already tried to google filedialog filter date with no success. I am not really sure if this type of filter (date filter) can be added to the filedialog.

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,840
    sounds like you'll need to write your own - found this link which contains a post about accessing file properties

    http://stackoverflow.com/questions/1...r-like-abc-pdf

  5. #5
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,840

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    As pointed out in post #2 you can filter results based on a single file type. Be sure to clear filters before applying filters.

    You can also specify a default directory.

    I am not aware of a way to filter based on filename, only extension.

  7. #7
    fritesmodern is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    13

    File Dialog with Fiters

    Thanks for your help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Open .csv with fileDialog then TransferSpreadsheet
    By corptkm in forum Programming
    Replies: 1
    Last Post: 01-27-2015, 11:43 AM
  2. FileDialog pass starting Folder as a variable
    By bbrazeau in forum Programming
    Replies: 3
    Last Post: 09-13-2013, 07:23 AM
  3. FileDialog Question
    By uaguy3005 in forum Programming
    Replies: 5
    Last Post: 06-27-2012, 02:01 PM
  4. Using FileDialog to export to Excel
    By zapouk in forum Import/Export Data
    Replies: 2
    Last Post: 04-20-2012, 04:31 AM
  5. FileDialog
    By Tomfernandez1 in forum Programming
    Replies: 9
    Last Post: 04-13-2011, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums