Access/VBA Library

GetPrivateProfileString

Syntax

GetPrivateProfileString( section, key, default, returnValue, nSize, filename )
Parameters
Name Type Description
section String Required. Name of the section in the INI-file.
key Any Required. Name of the key within the section speficied.
default String Required. Value to be returned when key does not exist.
returnValue String Required. Reference to buffer to store the retrieved value.
nSize Long Required. The maximum length of the buffer to store the retrieved value.
filename String Required. Full path to the INI-file.
Return value

Long : Length of the returned value.

Code
Private Declare Function GetPrivateProfileString _
      Lib "kernel32" Alias "GetPrivateProfileStringA" _
     (ByVal section As String, _
      ByVal key As Any, _
      ByVal default As String, _
      ByVal returnValue As String, _
      ByVal nSize As Long, _
      ByVal filename As String) As Long

See also

  • INI_GetValue