Returns a list of key settings and their respective values from an application’s Windows registry entry.
GetAllSettings(appname, section)
The GetAllSettings function syntax has these named arguments:
Part |
Description |
appname |
String expression containing the name of the application or project whose key settings are requested. |
section |
String expression containing the name of the section whose key settings are requested. GetAllSettings returns a Variant whose contents is a two-dimensional array of strings containing all the key settings in the specified section and their corresponding values. |
GetAllSettings returns an uninitialized Variant if either appname or section do not exist.
DeleteSetting Statement, GetSetting Function, SaveSetting Statement.
This example first uses the SaveSetting statement to make entries in the Windows registry (or .INI file on 16-bit Windows platforms) for the application specified as appname, then uses the GetAllSettings function to display the settings. Note that application names and section names cannot be retrieved with GetAllSettings. Finally, the DeleteSetting statement removes the application’s entries.
' Variant to hold 2-dimensional array returned by GetAllSettings.MySettings As Variant ' Place some settings in the registry.(appname := "MyApp", section := "Startup", _ key := "Top", setting := 75)("MyApp","Startup", "Left", 50) ' Retrieve the settings.= GetAllSettings(appname := "MyApp", section := "Startup") For Settings = LBound(MySettings, 1) To UBound(MySettings, 1) Debug.Print MySettings(Settings, 0), MySettings(Settings, 1) Next Settings("MyApp", "Startup")