Results 1 to 4 of 4

Thread: working with folders -- questions.

  1. #1

    Thread Starter
    Lively Member Frank Mantooth's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    66

    Question working with folders -- questions.

    I am extracting some .bmp files by doubleclicking on a zip file i want to extract in file2. Those files are extracted fine (using winzip commandline) and then shows up in file3.
    I then have a textbox in which some input is given by the user determining what the folder name should be of the the new folder i want to move the .bmp files to. The code runs fine creating a folder but when it comes to moving the selected files in the file3 listbox i can´t figure out how to do it. I´m getting a "object required" error at the bottom. (Btw. totally newbee to this!!!)
    Here´s the code:

    Private Sub Command2_Click()
    Dim aa As String
    Dim fso As New FileSystemObject, bmpFile
    Dim TexDir As Variant
    aa = Text2.Text
    If Dir(Dir1.Path & "\" & "texture." & aa, vbDirectory + vbHidden + vbNormal + vbArchive + vbReadOnly + vbSystem) <> vbNullString Then
    MsgBox "Folder already exists! If you want to install multiple liveries from the same airline, just add a number", vbOKOnly + vbExclamation
    Exit Sub
    Else
    MkDir Dir1.Path & "\" & "texture." & aa
    End If

    Text3.Text = Dir1.Path & "\" & "texture." & aa ' just to see if it works ;-)

    Dir1.Refresh


    Dim i As Integer
    For i = 0 To File3.ListCount - 1
    If File3.Selected(i) = True Then
    bmpFile.Move (Dir1.Path & "\" & "texture." & aa) ' Object required here! how?

    End If
    Next i




    Next question:

    In the dir1 i could have several subfolders in the selected folder named "mode"l i.e. :
    model
    model.big
    model.bigger
    etc.

    I would like to add these to a combobox but only the letters AFTER the period for instance if there is only 1 folder then add "model", if there is a folder called "model" and "model.big" then add model and big.
    How do i do that

    Kind regards

    Frank

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    What is bmpFile?

  3. #3
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    You need to set it first

    Set bmpFile = fso.GetFile("c:\pathtoyour BMP file\mybmp.bmp")

  4. #4

    Thread Starter
    Lively Member Frank Mantooth's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    66
    the path is a folder called Temp in app.path and the filename is a variable, but i should be able to get the filename from the combobox once the files are extrated, right?

    so how do i do that with the fso?

    Frank

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