Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create Windows Folder (v2000)

    I am trying to add code to a command button to create a Windows Folder from a combo box. For instance, if the combo box reads 'NewFolder', I want the on-click event to create folder C:NewFolder.

    The part where I am stuck is what code will actually create the folder.
    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create Windows Folder (v2000)

    Here's one way that doesn't require any special references or advanced coding.

    <pre>On Error Resume Next

    MkDir strDirName
    If Err = 75 Then
    ' the folder exists already
    Else
    Err = 0
    ' try to create it again
    MkDir strDirName
    If Err = 75 Then
    ' the directory was created
    Else
    MsgBox "Error in Creating Folder: " & strDirName & ".", _
    vbExclamation, "Folder Create Failure"
    End If
    End If </pre>

    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Windows Folder (v2000)

    Charlotte,
    That was a huge help and it worked like a charm. Thanks a bunch!!

Posting Permissions

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