Stuart McLachlan
stuart at lexacorp.com.pg
Sat Mar 29 16:40:17 CST 2003
> Anybody got code to paste into Access that derives a short file name (i.e. > everything shortened to 8 letters ala c:\Progr~1\Micro~1\Micro~2\etc.)? > Ideally, I would like to use the ADH code to grab a filename then call a > function that shortens the filename appropriately. > Here's something I've just written (took all of 2 minutes): Public Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Function ShortPath(Longpath As String) Dim strShortpath As String * 255 Dim lngResult As Long lngResult = GetShortPathName(Longpath, strShortpath, 255) ShortPath = strShortpath End Function -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.