Results 1 to 2 of 2

Thread: Deleting certian characters from a string! HELP!

  1. #1

    Thread Starter
    Lively Member fujiyama17's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, OH
    Posts
    91
    Okay, I have this problem... I have code that allows the usre to create a folder, and then place it on the server, C drive, wherever they direct it to, except the initial drive. That is the problem... The user creates a folder, and then can only put it in a folder within a drive, and can't just put it on the drive. My observation is that the error is occuring because two foward slashes are being delivered as the path instead of one. For example, it works for putting in a folder. You create the folder, "Monkeybutt". Alright. You can put it in C:\thisisafolder\monkeybutt\ but if you put it in just the "C:\" drive, you get C:\\monkeybutt, and that is invlaid. Can someone tell me how I can take off that "\" when I want to specify a drive? Like, If character 4 equals "\" Then delete? How would I do that? Any help would be great! Thanks! Here is the code that I have now...

    Private Sub Command3_Click()
    Dim strResFolder As String
    Dim x
    x = InputBox("What is the name of the folder you would like to create?")
    If x = "" Then
    MsgBox "Please Choose the other button to browse a folder", vbExclamation
    Exit Sub
    Else
    strResFolder = BrowseForFolder(hwnd, "What directory would you like the folder to be created in?")
    End If
    If strResFolder <> "" Then
    MkDir strResFolder & "\" & x
    MsgBox "You have choosen to place the file(s)/folders in the " & x & " folder under the directory " & strResFolder & "", vbExclamation
    Text1 = strResFolder & "\" & x
    Else
    MsgBox "Cancel was pressed! Folder was not created!", 16
    Exit Sub
    End If
    End Sub

    ~Brian

  2. #2

    Thread Starter
    Lively Member fujiyama17's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, OH
    Posts
    91
    No one knows how to do this?? If there is a better way than what I suggested, that would be sweet as well! Thanks!!

    ~Brian

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