Access/VBA Library

WritePrivateProfileString

Syntax

WritePrivateProfileString( section, key, value, 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.
value Any Required. The value to be assigned to the key.
filename String Required. Full path to the INI-file.
Return value

Long : A non-zero value if the call was succesfull, otherwise zero.

Code
Private Declare Function WritePrivateProfileString _
      Lib "kernel32" Alias "WritePrivateProfileStringA" _
     (ByVal section As String, _
      ByVal key As Any, _
      ByVal value As Any, _
      ByVal filename As String) As Long

Remarks

  • If the INI-file does not exist it will be created.

See also

  • INI_SetValue