O'Reilly logo

VB & VBA in a Nutshell: The Language by Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required