Private Declare Function GetShortPathName Lib 'kernel32' Alias 'GetShortPathNameA' (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Const MAX_PATH_LENGHT = 255
Public RepLong As String
Sub RepCourt()
Dim tmpShortPath As String
Dim RC As Long
tmpShortPath = Space(MAX_PATH_LENGHT + 1)
RC = GetShortPathName(RepLong, tmpShortPath, MAX_PATH_LENGHT + 1)
RepLong = Left(tmpShortPath, InStr(tmpShortPath, Chr$(0)) - 1)
End Sub