Private Declare Function GetShortPathName Lib "kernel32" _ Alias "GetShortPathNameA" ( _ ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, _ ByVal lBuffer As Long) As Long
Public Function GetShortPath(ByVal strFile As String) As String Dim lngRes As Long Dim strSpace As String strSpace = Space$(255) lngRes = GetShortPathName(strFile, strSpace, 255) GetShortPath = Left$(strSpace, lngRes) End Function
Private Sub Form_Load() Dim strPath As String 'HUSK at stigen skal være på computeren ellers virker det ikke. strPath = "C:\Documents and Settings\Default User\Lokale indstillinger\Temp" MsgBox GetShortPath(strPath) End Sub '-------------------------------- Form1 --------------------------------
ang. den mest simple måde, så ville jeg nu nok vælge min :)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.