Public Function CatFileAllName(PathName As String, FileName As String) As String
If Right$(PathName, 1) = "\" Then
CatFileAllName = PathName + FileName
Else
CatFileAllName = PathName + "\" + FileName
End If
'把长文件名转成8.3文件名:
Public Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Public Function GetShortFN(FNStr As String) As String
Dim TempStr As String
Dim TempLen As Long
Dim Rc As Long
TempLen = &H400
TempStr = String$(TempLen, 0)
Rc = GetShortPathName(FNStr, TempStr, TempLen)
If Rc Then
GetShortFN = StrConv(LeftB(StrConv(TempStr, vbFromUnicode), Rc), vbUnicode)
'Debug.Print GetShortFN, Asc(Right$(GetShortFN, 1))
End If