GETSETTING(appname, section, key [,default])

Reads from the registry and returns the value or key from the registry (String).


appnameThe name of the application or project (String).
sectionThe name of the section (String).
keyThe name of the key to return (String).
default(Optional) The value to return if no value has been set (Variant ??).

REMARKS
* This can only be used to retrieve values under the MyComputer\HKEY_CURRENT_USER\Software\VB and VBA Program Settings\
* If you need to retrieve values from a different part of the registry you need to use the Windows API.
* The "appname" is the subkey below the "VB and VBA Program Settings" key.
* The "section" is the subkey of the key specified in the "appname" argument.
* The "key" is the value of the key specified in the "section" argument.
* If "default" is left blank, then it is assumed to be zero length string ("").
* If either "appname", "section" or "key" do not exist then the "default" value is returned.
* For more information, refer to the Macros > Registry page.
* The equivalent .NET function is Microsoft.VisualBasic.Interaction.GetSetting
* For the Microsoft documentation refer to docs.microsoft.com

Msgbox GetSetting("MyApp","MySection","MyKey") = "MySettingValue" 
Msgbox GetSetting("MyApp","MySection","DifferentKey","does not exist") =
Msgbox GetSetting("My Amazing Add-in","User Settings","FullName") = "David Smith"

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top