How to return the path to the system directory.
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 | 'System & API - How to return the path to the system directory. Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" _ (ByVal lpBuffer As String, ByVal nSize As Long) As Long Public Function SystemDir() As String Dim Gwdvar As String, Gwdvar_Length As Integer Gwdvar = Space(255) Gwdvar_Length = GetSystemDirectory(Gwdvar, 255) SystemDir = Left(Gwdvar, Gwdvar_Length) End Function 'How can I call this function: 'Debug.Print SystemDir |