Certainly. In Module1 I pasted:<br>
<br>
Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long<br>
<br>
Function LongToShort(LongFilename As String) As String<br>
Dim ShortFileName As String<br>
Dim Retval As Integer<br>
ShortFileName = Space$(256)<br>
Retval = GetShortPathName(LongFilename, ShortFileName, Len(ShortFileName))<br>
LongToShort = Left$(ShortFileName, Retval)<br>
End Function<br>
<br>
...just like you posted. I created a label (Label1), a dir box, a drive box and a file list box (Dir1, Drive1 and File1), and used this code to test the LongToShort function:<br>
<br>
Private Sub Dir1_Change()<br>
File1 = Dir1<br>
End Sub<br>
<br>
Private Sub Drive1_Change()<br>
Dir1 = Drive1<br>
End Sub<br>
<br>
Private Sub File1_Click()<br>
If Right$(Dir1, 1) = "\" Then<br>
Label1 = LongToShort(Dir1 & File1)<br>
Else<br>
Label1 = LongToShort(Dir1 & "\" & File1)<br>
End If<br>
End Sub<br>
<br>
Label1 shows the MS-DOS path/filename. I just did this to test the function. When I use it in my project I'll have to find a way to get the full path to the filename returned by the Dir function. Do you have any ideas?<br>
<br>
Thanks again.