ConvLongName




Declare Function GetShortPathName Lib "KERNEL32" _
Alias "GetShortPathNameA" _
(ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long

Public Function GetShortFileName(ByVal FileName As String) As String
Dim rc As Long
Dim ShortPath As String
Const PATH_LEN& = 164
ShortPath = String$(PATH_LEN + 1, 0)
rc = GetShortPathName(FileName, ShortPath, PATH_LEN)
GetShortFileName = Left$(ShortPath, rc)
End Function

'Dove FileName e' il path o il nome del file da convertire e

'ritorna un nome DOS compatibile, pertanto si dichiarera':


Dim Lblshort, LongName as string
Lblshort = GetShortFileName(LongName)










( convlongname.html )- by Paolo Puglisi - Modifica del 17/12/2023