[AccessD] Code to render ShortFileName

Arthur Fuller artful at rogers.com
Sun Mar 30 09:22:22 CST 2003


Thanks. I'll take it for a spin right now.

A.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: March 29, 2003 5:40 PM
To: Arthur Fuller; accessd at databaseadvisors.com
Subject: Re: [AccessD] Code to render ShortFileName


> 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.



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list