DCrake
Remembered
- Local time
- Today, 16:34
- Joined
- Jun 8, 2005
- Messages
- 8,620
Simple Software Solutions
Without actually looking at your code, you need to find the line that adds the item to the list box first.
Once you have located this - it should look something like
Me.Listbox.AddItem (path and file name)
What you need to do is to split the line into two sections, the file path and the file name. To do this use the InStrRev(String,"\") to locate the last backslash in the string. Everything before this position is the path, and everything after this point is the file name. Store the filename to a string variable and use this string for the AddItem code.
Example:
Full path and file name:
StrString = "C:\Windows\System32\Help.hlp"
X = InStrRev(StrString,"\")
X = 20
StrPath = Left(StrString,X)
StrFile = Mid(StrStirng,X+1)
Coded for brevity
CodeMaster:
Without actually looking at your code, you need to find the line that adds the item to the list box first.
Once you have located this - it should look something like
Me.Listbox.AddItem (path and file name)
What you need to do is to split the line into two sections, the file path and the file name. To do this use the InStrRev(String,"\") to locate the last backslash in the string. Everything before this position is the path, and everything after this point is the file name. Store the filename to a string variable and use this string for the AddItem code.
Example:
Full path and file name:
StrString = "C:\Windows\System32\Help.hlp"
X = InStrRev(StrString,"\")
X = 20
StrPath = Left(StrString,X)
StrFile = Mid(StrStirng,X+1)
Coded for brevity
CodeMaster: