Thanks, Justinlabenne.Quote:
Originally Posted by Justinlabenne
I can wait for 2/3 days....if possible.....:friends:
Btw, I appreciate your hard work and effort. :beerchug:
Printable View
Thanks, Justinlabenne.Quote:
Originally Posted by Justinlabenne
I can wait for 2/3 days....if possible.....:friends:
Btw, I appreciate your hard work and effort. :beerchug:
Anybody test this and see if any flaws can be found?
I was falling asleep doing it, so there may be oversights, but it seems ok minus some actual error handling:
Initial testing is GOOD! :thumb
I try testing more aggresively tomolo. :cool:
Thank you for your time and effort..... :friends:
Thanks. :hi:
Hi Justin and Sheeng
One small suggestion, add the following to the userform code to open the browse window automatically.
Code:Private Sub UserForm_Initialize()
cmdLoadFiles_Click
End Sub
Justin
When I choose C: from the folder browser I get a Run time error 52 - Bad file name or number.
Another minor change to avoid errors on empty disk drives.
Code:Private Sub cmdLoadFiles_Click()
Const sBrowseMsg As String = "Select a folder"
Dim sPath As String
Dim sFiles As String
Dim tmp
lstFiles.Clear
' Browse for our folder:
sPath = BrowseFolders(ApphWnd, sBrowseMsg, BrowseForFoldersOnly, CSIDL_DRIVES)
' if nothing is selected, or cancel pressed
If sPath = "" Then Exit Sub
On Error Resume Next
Dir sPath
If Err <> 0 Then
sPath = "No disc in " & sPath
GoTo ErrH
End If
' What files do we have in our folder?
' Look at all types
sFiles = Dir(sPath & "\*.*", vbNormal)
Do Until sFiles = ""
' Using a loop, load the file names into the listbox
With lstFiles
.AddItem sFiles
End With
sFiles = Dir()
Loop
ErrH:
' Show selected folder path on the form
Me.Caption = sPath
' Return focus to the form
lstFiles.SetFocus
End Sub
Just one other point Clear your listbox After deciding to carry on further
Also, as you are actually opening any file type it would also pay to includeCode:
If sPath = "" Then Exit Sub
lstFiles.Clear
an "Open With" dialog for those files not associated with a file type by the use of the SHell API. You can do this via RunDll
Thanks for the feedback, added the changes posted so far. I personally would prefer to filter the list of files to certain types (I personally dont need a list of .dll's to open if you browse to C:\Windows, :dunno)
Just my preference.
I was wondering what the interest level of this is to everybody, would it be useful as an add-in at all? Since this generated some feedback, I planned adding the files into an array to sort by extension or something, and to filter the list so we don't have to go the rundll route, with an "Open With" dialog. Just my opinion, and most certainly would add it in if eveyone would agree that it is necessary, I don't think I do, but I am thinking from a developer standpoint, let me know what everyone's thinking and I welcome your ideas as to other items to include if the interest is there.
Later, and here is a copy updated, I moved all code into the Userform module for further encapsulation plus the above additions
Hi Justin,
I agree with the dll files, and you should also consider exe files which maybe should not be run from this type of utility.
Regarding the setup, I think the single click to open files is too "sensitive". I prefer a double click/button with a keyboard alternative, which allows me to scroll down a list highlighting each, then pressing Enter to open the desired file.
I also do prefer double click. :friends: Can someone help out to proceed with Load Folder Content in Single Column List Box and double click an item in the list box to open?Quote:
Originally Posted by mdmackillop
Thanks : pray2:
Filter by all means, but an Open With is a user interface option that most users are use to with this type of thing... it's not to open a Dll, more another option that I as a user like to have as I have more then ONE application that I use to open files with. eg App open with Hex Editor, VB.NET, or another application that supports the file type. As a developer you need to be thinking along the lines of what your customers want and to point out to them other options that they may not have thought of.. other wise nice job :)Quote:
Originally Posted by Justinlabenne
Quote:
Originally Posted by Justinlabenne
How true Ivan :bow:
I have yet to develop anything for anybody that is a user quite near your level, and most people I work for usually freak if they get an Open With dialog, (If it doesn't just open by double clicking on it, the world is over)
Here is where it is at so far, needs some work as far as sorting a bit I think, but I have the extensions filtered a bit, feel free to add to the list If you would like to see more inclusions. I will see what I can whip for an Open With dialog, got school tommorrow so it may be a bit for I can get back to it, whoever wants to add to the file, by all means do so, Thanks for the feedback so far..
Sheeeng, it now includes the Double click event.
Later,
Oh, and I renamed it, got tired of Listbox Loader
Thanks, a lot. :friends:Quote:
Originally Posted by Justinlabenne
Great work!! :thumb
Hi Justin,
Don't know if it's needed, but you can also use FollowHyperlink as a method for opening files.
Updated: seems messy to me, but think I got most options covered.
See what you think.
Why is there so many changes in ur last file?Quote:
Originally Posted by Justinlabenne
Can you explain the functionality of it?
Thx. :friends:
Hi Justin and all,Quote:
Originally Posted by Justinlabenne
Have you manege to come up with the codes on this...?
Thx. :friends:
This is the add-in version, looks a lot different than the ones from the previous posts.
File Finder
Hi Justin,
A couple of minor points.
If I click off the "Stay Open" option, I still cannot close the form.
Would it be possible for the option button/File type selection to apply the filter to the list of files, if the folder has already been selected?
Thanks for the feedback, I have been working on a reliable way to filter the list after the folder has already been selected, but just havent had the time to devote to getting it perfected.
I have some other things I want to add into the add-in also, like the ability to kill a specific file from the list (maybe, but with lots of warning prompts) and some reworking of selecting the folder (it does get awful annoying to keep having to select one) so, I will be updating it hopefully soon,
In regards to closing the form, are you talking about clicking on the red [x]? I used a template form and left a query_close procedure in as normally I prompt users to close specifically by using the close button. Probably not needed here, my bad...:doh:
Again, thanks for the feedback, hope to make it better soon..