geoleob's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
48 (0.05 per day)
Joined:
06-August 12
Profile Views:
915
Last Active:
User is offline Feb 13 2015 06:32 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   geoleob has not set their status

Posts I've Made

  1. In Topic: filtering the dirlistbox

    Posted 13 Feb 2015

    
      ' Add reference to fileScriptingObject!! 
    
    Dim wrkFSO As New Scripting.FileSystemObject
    Dim wrkFolder As String
    Dim strStartPath As String
    Dim FS As New FileSystemObject
    Dim FSfolder As Folder
    Dim subfolder As Folder
    
    Private Sub Form_Load()
    
         
       strStartPath = "C:\"
       
       ListFolder strStartPath
    
       
    End Sub
    
    Private Sub ListFolder(sFolderPath As String)
    
       Set FSfolder = FS.GetFolder(sFolderPath)
     
      ' There may better ways to use the 'If-Then-Else', but I like to keep code readable
      ' I came from an AS/400 RPG environment!! 
    
      
       For Each subfolder In FSfolder.SubFolders
          If Len(subfolder) = 5 Then
             If subfolder <> "C:\hp" Then
                If subfolder <> "C:\VA" Then
                   If subfolder <> "C:\BI" Then
                      If subfolder <> "C:\VD" Then
                         frm02List.AddItem subfolder
                      End If
                   End If
                End If
             End If
          End If
       Next subfolder
    
       Set FSfolder = Nothing
    
         
    End Sub
    
    
  2. In Topic: filtering the dirlistbox

    Posted 12 Feb 2015

    View Postandrewsw, on 12 February 2015 - 04:19 PM, said:

    Here's a screencast that shows how to use code tags.

    Note also that you don't need to quote a previous post each time, there is a Reply button further down the page.


    Andrew,

    Can not find the 'Reply" button.
    Also, I will have to study the code formatting rules to fully understand on how to do it.
    Thanks for you help!!
  3. In Topic: filtering the dirlistbox

    Posted 12 Feb 2015

    View Postmaj3091, on 12 February 2015 - 12:06 AM, said:

    Glad you got it sorted. Maybe you'd like to post your solution for others that may have a similar problem in future.


    MAJ,

    Be glad to post my code, not sure how to do it!
  4. In Topic: filtering the dirlistbox

    Posted 11 Feb 2015

    View Postmaj3091, on 11 February 2015 - 12:31 AM, said:

    Not sure you can filter the DirList how you want to (but may be mistaken).

    Depending on what you want to filter it for, then you could look at using the FileSystemObject and filtering it manually.

    In this link, there are a couple of examples of listing folders in a loop. You should be able to adapt one of these to only store the ones that meet your criteria (by length or whatever you need).


    MAJ,

    Thanks, it worked perfectly!!
  5. In Topic: filtering the dirlistbox

    Posted 10 Feb 2015

    Andrewsw,

    thanks for the reply. My problem is that some of the folders have 2 character names (ie "C:\FC"). These I want to display .

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

geoleob hasn't added any friends yet.

Comments

geoleob has no profile comments yet. Why not say hello?