GETSETTING |
GETSETTING(appname, section, key [,default]) |
Reads from the registry and returns the value or key from the registry (String). |
appname | The name of the application or project (String). |
section | The name of the section (String). |
key | The name of the key to return (String). |
default | (Optional) The value to return if no value has been set (String). |
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 learn.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"
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top