Results 1 to 2 of 2

Thread: Folder Contents

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2004
    Posts
    16

    Folder Contents

    How could you check to see if there is anything inside of a folder?
    Thanks

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    You can use the Dir$() function.

    Here is a simplistic approach (will test for ANY type of file; ie .txt, .jpg etc)
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     If Dir$("C:\WINNT\*.*", vbNormal) <> "" Then MsgBox "Folder is not empty"
    5. End Sub




    Bruce.

Posting Permissions

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



Click Here to Expand Forum to Full Width