GetAllSettings Function

Named Arguments

Yes

Syntax

GetAllSettings(appname, section)

appname

Use: Required

Data Type: String

Name of the application.

section

Use: Required

Data Type: String

Relative path from appname to the key containing the settings to retrieve.

Return Value

A Variant containing a two-dimensional array of strings.

Description

Returns the registry value entries and their corresponding values for the application.

Rules at a Glance

  • GetAllSettings works exclusively with the subkeys of HKEY_CURRENT_USER\Software\VB and VBA Program Settings.

  • The elements in the first dimension of the array returned by GetAllSettings contain the value entry names.

  • The elements in the second dimension of the array returned by GetAllSettings contain the values for the respective value entries.

  • The two-dimensional array returned by GetAllSettings is based at zero. Therefore, the first value entry name is referenced using (0,0).

  • A call to GetAllSettings returns only the value entry names and data belonging to the final registry key specified by the section argument. If that key itself has one or more subkeys, their data isn't retrieved by the function.

  • If an application has multiple nested subkeys, all their data can be retrieved by specifying the relative path from the application key to the desired key in the section parameter. For example, if Settings\Coordinates is the value of the section argument, the function attempts to retrieve all values from the subkey HKEY_CURRENT_USER\Software\VB ...

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.