|
-
Nov 8th, 2004, 04:10 PM
#1
Thread Starter
Lively Member
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
-
Nov 8th, 2004, 04:24 PM
#2
-
Nov 8th, 2004, 05:04 PM
#3
Frenzied Member
You need to set it first
Set bmpFile = fso.GetFile("c:\pathtoyour BMP file\mybmp.bmp")
-
Nov 8th, 2004, 05:48 PM
#4
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|