Is it possible to open a file with spaces in it's name with the f***ing shell method without having to convert the name into his (MS-DOS) short spelling??
Printable View
Is it possible to open a file with spaces in it's name with the f***ing shell method without having to convert the name into his (MS-DOS) short spelling??
It should allow for that. I tried doing that in VB5 and it worked. Are you sure you have the right long file name?
It's not hard to convert it. Just use this, and you don't have to worry at all. If this short path doesn't work, the file isn't there :).
VB Code:
Public Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal strLongPath As String, ByVal strShortPath As String, ByVal lngBufferLength As Long) As Long Public Function ShortPath(ByVal strLongPath As String) As String Dim strBuffer As String * 256 Dim lngLength As Long lngLength = GetShortPathName(strLongPath, strBuffer, Len(strBuffer)) ShortPath = Left$(strBuffer, lngLength) End Function
Thanks!
It worked well!
This function saves me a lot of time!