Consulting

Results 1 to 5 of 5

Thread: Solved: File Extension Filtering

  1. #1
    VBAX Regular
    Joined
    Sep 2008
    Location
    Wyoming
    Posts
    41
    Location

    Solved: File Extension Filtering

    I searched the forums but did not find a similar topic. I am using the common dialog box and trying to filter for files with a *.btb and *.wss extension. The dialog box still shows all the files and folders in that directory. Am I using the incorrect syntax for this filter?

    With cdbDialog
    .Filter = "*.btb, *.wss"
    .ShowOpen
    End With

  2. #2
    This should work:

    .Filter = "btb(*.btb)" & vbNullChar & "*.btb" & vbNullChar & "wss(*.wss)" & vbNullChar & "*.wss"

  3. #3
    VBAX Regular
    Joined
    Sep 2008
    Location
    Wyoming
    Posts
    41
    Location
    Thanks for the quick response. It still displayed files with extensions other than those two.

    Here is what I ended up using. Not quite what I wanted but it should work.

    .Filter = "Blue Tops (*.btb)|*.btb|Wyoming Slope Stakes (*.wss)|*.wss"

  4. #4
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    .Filter ="Blue Tops/Wyoming Slope Stakes(*.btp;*.wss)|*.btp;*.wss;"

  5. #5
    VBAX Regular
    Joined
    Sep 2008
    Location
    Wyoming
    Posts
    41
    Location
    That is what I needed. Thanks shamsam1.

Posting Permissions

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