|
-
Sep 4th, 2001, 09:23 PM
#1
Thread Starter
Fanatic Member
how can i use this code or any code to get the full path including the name?
im usin the below code to get the path for the file that is draged over a listbox.
VB Code:
Public Function GetPath(ByVal sFile As String, Optional ByVal Slash = False) As String
'True shows "\" at the end
'False doesn't
GetPath = IIf(Slash = False, Left$(sFile, InStrRev(sFile, "\") - 1), Left$(sFile, InStrRev(sFile, "\")))
End Function
so when i use it i get C:\WINDOWS\Desktop\
but i wana get the full path. i.e. C:\WINDOWS\Desktop\filename.txt
how could i do this?
-
Sep 4th, 2001, 09:57 PM
#2
Fanatic Member
Where are you getting the string passed to sFile? The function above strips the path out of the full path name which means to get the full path just don't use that function.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Sep 4th, 2001, 10:19 PM
#3
That is the code I gave you. Forget that code completely. Don't use it at all. Just set the OLEDropMode of the Listbox to 1-Manual and add this code to your form.
VB Code:
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox Data.Files(1)
End Sub
Not hard at all, simple little task, the answer was given in your other thread as well.
I had misunderstood your question and wrote that code, I'm sorry, but it wasn't needed at all.
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
|