I agree with Lord Orwell, if you can't use long filenames use the short 8.3 version of it. Here's some code that will help you getting the 8.3 path:vb Code:
Private Declare Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameA" ( _ ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, _ ByVal cchBuffer As Long _ ) As Long Public Function ShortPath(ByVal sLongPath As String) As String Const MAX_PATH As Long = 260& Dim sShortPath As String Dim nLen As Long sShortPath = String(MAX_PATH, vbNullChar) nLen = GetShortPathName(sLongPath, sShortPath, MAX_PATH) ShortPath = Left(sShortPath, nLen) End Function




Reply With Quote